diff --git a/package.json b/package.json index 225f7290..f6575d98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photon-lemmy", - "version": "1.13.1", + "version": "1.13.2", "private": true, "scripts": { "dev": "vite dev", diff --git a/src/routes/profile/(local_user)/password/+page.svelte b/src/routes/profile/(local_user)/password/+page.svelte index 3e225c33..f92b9ed1 100644 --- a/src/routes/profile/(local_user)/password/+page.svelte +++ b/src/routes/profile/(local_user)/password/+page.svelte @@ -11,9 +11,9 @@ let loading = false async function submit() { - loading = true - const res = await trycatch(async () => { + try { if (!$profile?.jwt) return + loading = true const res = await getClient().changePassword({ auth: $profile?.jwt, new_password: newPassword, @@ -30,9 +30,14 @@ } else { throw new Error('Invalid credentials') } - }) - if (res) toast({ content: 'Successfully changed your password. ' }) + toast({ content: 'Successfully changed your password. ' }) + } catch (e) { + toast({ + content: e as any, + type: 'error', + }) + } loading = false }