@lumiapassport/ui-kit 1.14.25 → 1.14.26
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.
- package/dist/index.cjs +40 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4335,8 +4335,9 @@ async function changeNickname(handle) {
|
|
|
4335
4335
|
}
|
|
4336
4336
|
async function checkNicknameAvailability(handle) {
|
|
4337
4337
|
const normalizedHandle = handle.toLowerCase().replace(/^@/, "");
|
|
4338
|
-
const response = await tssClient.
|
|
4339
|
-
|
|
4338
|
+
const response = await tssClient.post(
|
|
4339
|
+
"/api/auth/nicknames/check",
|
|
4340
|
+
{ handle: normalizedHandle },
|
|
4340
4341
|
false
|
|
4341
4342
|
// Public endpoint, no auth required
|
|
4342
4343
|
);
|
|
@@ -4348,14 +4349,15 @@ async function checkNicknameAvailability(handle) {
|
|
|
4348
4349
|
}
|
|
4349
4350
|
async function resolveNickname(handle) {
|
|
4350
4351
|
const normalizedHandle = handle.toLowerCase().replace(/^@/, "");
|
|
4351
|
-
const response = await tssClient.
|
|
4352
|
-
|
|
4352
|
+
const response = await tssClient.post(
|
|
4353
|
+
"/api/auth/nicknames/resolve",
|
|
4354
|
+
{ handle: normalizedHandle },
|
|
4353
4355
|
false
|
|
4354
4356
|
// Public endpoint, no auth required
|
|
4355
4357
|
);
|
|
4356
4358
|
if (!response.success || !response.data) {
|
|
4357
|
-
const errorData = response.data;
|
|
4358
|
-
if (errorData
|
|
4359
|
+
const errorData = response.data || {};
|
|
4360
|
+
if (errorData.code === "NICKNAME_NOT_FOUND") {
|
|
4359
4361
|
const error = new Error("Nickname not found");
|
|
4360
4362
|
error.code = "NICKNAME_NOT_FOUND";
|
|
4361
4363
|
throw error;
|
|
@@ -5948,12 +5950,21 @@ function useBackupStatusChanges() {
|
|
|
5948
5950
|
const { mutate: handleBackupStatusChanged } = (0, import_react_query6.useMutation)({
|
|
5949
5951
|
mutationFn: async (event) => {
|
|
5950
5952
|
const customEvent = event;
|
|
5951
|
-
|
|
5953
|
+
console.log("[BACKUP STATUS] changed:", customEvent?.detail);
|
|
5954
|
+
return { stats: await getShareRecoveryStats(), detail: customEvent?.detail };
|
|
5952
5955
|
},
|
|
5953
|
-
onSuccess: (stats) => {
|
|
5956
|
+
onSuccess: ({ stats, detail }) => {
|
|
5954
5957
|
const hasRecoveryData = stats && (!!stats.created || !!stats?.devices?.length);
|
|
5955
5958
|
if (!!hasRecoveryData) {
|
|
5959
|
+
console.log(
|
|
5960
|
+
"[BACKUP STATUS] Recovery data found after backup status change.\n Redirect to main menu:",
|
|
5961
|
+
detail?.navigateToMainMenu
|
|
5962
|
+
);
|
|
5956
5963
|
setHasServerVault(true);
|
|
5964
|
+
if (!!detail?.navigateToMainMenu) {
|
|
5965
|
+
setTimeout(() => setPage("main-menu" /* MAIN_MENU */), 1e3);
|
|
5966
|
+
}
|
|
5967
|
+
console.info("[BACKUP STATUS] Recovery data found in vault, marking as has-server-vault");
|
|
5957
5968
|
} else {
|
|
5958
5969
|
setHasServerVault(false);
|
|
5959
5970
|
setPage("keysare-backup" /* KEYSARE_BACKUP */);
|
|
@@ -8368,6 +8379,9 @@ Switch.displayName = "Switch";
|
|
|
8368
8379
|
var import_lucide_react18 = require("lucide-react");
|
|
8369
8380
|
var import_react28 = require("react");
|
|
8370
8381
|
|
|
8382
|
+
// src/internal/components/KeyshareRestoreMenu/hooks/useOnRestoreSuccess.ts
|
|
8383
|
+
var import_react25 = require("react");
|
|
8384
|
+
|
|
8371
8385
|
// src/internal/components/KeyshareRestoreMenu/hooks/useRestoreStore.ts
|
|
8372
8386
|
var import_zustand4 = require("zustand");
|
|
8373
8387
|
var useRestoreStore = (0, import_zustand4.create)((set) => ({
|
|
@@ -8396,7 +8410,6 @@ var useRestoreStore = (0, import_zustand4.create)((set) => ({
|
|
|
8396
8410
|
}));
|
|
8397
8411
|
|
|
8398
8412
|
// src/internal/components/KeyshareRestoreMenu/hooks/useOnRestoreSuccess.ts
|
|
8399
|
-
var import_react25 = require("react");
|
|
8400
8413
|
function useOnRestoreSuccess() {
|
|
8401
8414
|
const { config, callbacks } = useLumiaPassportConfig();
|
|
8402
8415
|
const setIsDialogForced = useLayoutStore((st) => st.setIsDialogForced);
|
|
@@ -8534,20 +8547,25 @@ function useCreateBackup() {
|
|
|
8534
8547
|
if (!usePasskey && !restorePassword) {
|
|
8535
8548
|
throw new Error("Please provide a password for the backup");
|
|
8536
8549
|
}
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8550
|
+
const navigateToMainMenu = jwt.isNewUser || !hasServerVault;
|
|
8551
|
+
console.log("[BACKUP STATUS] is new user:", jwt.isNewUser, !hasServerVault);
|
|
8552
|
+
return {
|
|
8553
|
+
response: await iframeManager.createBackup(
|
|
8554
|
+
passportUserId,
|
|
8555
|
+
{ method: "server", password: restorePassword },
|
|
8556
|
+
jwt.accessToken
|
|
8557
|
+
),
|
|
8558
|
+
navigateToMainMenu
|
|
8559
|
+
};
|
|
8542
8560
|
},
|
|
8543
|
-
onSuccess: async (response) => {
|
|
8561
|
+
onSuccess: async ({ response, navigateToMainMenu }) => {
|
|
8544
8562
|
qc.invalidateQueries({ queryKey: [CHECK_BACKUP_QUERY_KEY, address] });
|
|
8545
8563
|
if (response.success) {
|
|
8546
8564
|
setSuccess("Successfully created server backup");
|
|
8547
8565
|
if (typeof window !== "undefined") {
|
|
8548
8566
|
window.dispatchEvent(
|
|
8549
8567
|
new CustomEvent("lumia-passport-backup-status-changed", {
|
|
8550
|
-
detail: { method: "server", success: true }
|
|
8568
|
+
detail: { method: "server", success: true, navigateToMainMenu }
|
|
8551
8569
|
})
|
|
8552
8570
|
);
|
|
8553
8571
|
}
|
|
@@ -9598,6 +9616,12 @@ function KeyshareBackupMenu() {
|
|
|
9598
9616
|
(0, import_react33.useEffect)(() => {
|
|
9599
9617
|
setMainPageHeight(DEFAULT_SETTINGS_MENU_HEIGHT);
|
|
9600
9618
|
return () => {
|
|
9619
|
+
setSuccess(null);
|
|
9620
|
+
setError(null);
|
|
9621
|
+
setRestoreFile(null);
|
|
9622
|
+
setRestorePassword("");
|
|
9623
|
+
setShowPassword(false);
|
|
9624
|
+
setUsePasskey(false);
|
|
9601
9625
|
setMethod(null);
|
|
9602
9626
|
};
|
|
9603
9627
|
}, []);
|