@isoftdata/svelte-user-configuration 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -51,8 +51,16 @@ $: disablePasswordChange = changePasswordMode && !currentPassword || passwordMis
|
|
|
51
51
|
on:submit={async e => {
|
|
52
52
|
e.preventDefault()
|
|
53
53
|
if (!disablePasswordChange && confirmPasswordSet) {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
try {
|
|
55
|
+
const success = await confirmPasswordSet({ currentPassword, newPassword })
|
|
56
|
+
if (success) {
|
|
57
|
+
show = false
|
|
58
|
+
}
|
|
59
|
+
} catch (err) {
|
|
60
|
+
//In case the consumer doesn't handle their own error messages
|
|
61
|
+
console.error(err)
|
|
62
|
+
err instanceof Error ? alert(err.message) : undefined
|
|
63
|
+
}
|
|
56
64
|
}
|
|
57
65
|
}}
|
|
58
66
|
>
|
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
confirmPasswordSet?: ((ctx: {
|
|
8
8
|
currentPassword: string;
|
|
9
9
|
newPassword: string;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => boolean | Promise<boolean>) | undefined;
|
|
11
11
|
open?: (userAccount?: UserAccount) => Promise<void>;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
<script>import { getContext
|
|
1
|
+
<script>import { getContext } from "svelte";
|
|
2
2
|
import Icon from "@isoftdata/svelte-icon";
|
|
3
3
|
import Input from "@isoftdata/svelte-input";
|
|
4
4
|
import Button from "@isoftdata/svelte-button";
|
|
5
5
|
import TextArea from "@isoftdata/svelte-textarea";
|
|
6
6
|
import PasswordSetModal from "./PasswordSetModal.svelte";
|
|
7
|
-
import PasswordFields from "@isoftdata/svelte-password-fields";
|
|
8
7
|
import DeactivateUserModal from "./DeactivateUserModal.svelte";
|
|
9
8
|
import PasswordRecoveryModal from "./PasswordRecoveryModal.svelte";
|
|
10
9
|
import { translate as defaultTranslate } from "@isoftdata/utility-string";
|