Skip to content

Commit

Permalink
Update PasswordSettings.svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
narthur committed Nov 17, 2024
1 parent 0834a8e commit 22b0063
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/PasswordSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
let shouldShowMismatch = false;
let loading = false;
let error = '';
let success = '';
const savePassword = async (event: Event) => {
event.preventDefault();
Expand All @@ -17,6 +18,7 @@
try {
await updatePassword(oldPassword, password);
error = '';
success = 'Password updated successfully';
} catch (e) {
error = e instanceof Error ? e.message : 'Failed to update password';
}
Expand All @@ -34,6 +36,9 @@
{#if error}
<div class="error">{error}</div>
{/if}
{#if success}
<div class="success">{success}</div>
{/if}

<label>
Old Password
Expand Down Expand Up @@ -103,6 +108,11 @@
margin-bottom: 1rem;
}
.success {
color: green;
margin-bottom: 1rem;
}
.error-text {
color: red;
font-size: 0.875rem;
Expand Down

0 comments on commit 22b0063

Please sign in to comment.