refac: $user

This commit is contained in:
Timothy Jaeryang Baek committed 2025-03-31 20:32:12 -07:00
1 parent 1b7c125f00
commit e0ec2cdeb0
27 files changed
+57 -57

No files matched your search

@@ -31,8 +31,8 @@
let profileImageInputElement: HTMLInputElement;
const submitHandler = async () => {
if (name !== $user.name) {
if (profileImageUrl === generateInitialsImage($user.name) || profileImageUrl === '') {
if (name !== $user?.name) {
if (profileImageUrl === generateInitialsImage($user?.name) || profileImageUrl === '') {
profileImageUrl = generateInitialsImage(name);
}
}
@@ -75,8 +75,8 @@
};
onMount(async () => {
name = $user.name;
profileImageUrl = $user.profile_image_url;
name = $user?.name;
profileImageUrl = $user?.profile_image_url;
webhookUrl = $settings?.notifications?.webhook_url ?? '';
APIKey = await getAPIKey(localStorage.token).catch((error) => {
@@ -214,7 +214,7 @@
<button
class=" text-xs text-center text-gray-800 dark:text-gray-400 rounded-full px-4 py-0.5 bg-gray-100 dark:bg-gray-850"
on:click={async () => {
const url = await getGravatarUrl(localStorage.token, $user.email);
const url = await getGravatarUrl(localStorage.token, $user?.email);
profileImageUrl = url;
}}>{$i18n.t('Use Gravatar')}</button