사소한 리팩토링 3

This commit is contained in:
static
2025-07-12 05:58:35 +09:00
parent 4679b1d6bd
commit 89921ef1df
3 changed files with 25 additions and 26 deletions

View File

@@ -61,19 +61,6 @@
});
};
const importKeys = async () => {
const file = fileInput?.files?.[0];
if (!file) return;
if (await importClientKeys(await file.text())) {
await upgradeSession(false);
} else {
// TODO: Error Handling
}
fileInput!.value = "";
};
const upgradeSession = async (force: boolean) => {
const [upgradeRes, upgradeError] = await requestClientRegistrationAndSessionUpgrade(
$clientKeyStore!,
@@ -109,6 +96,19 @@
await goto("/client/pending?redirect=" + encodeURIComponent(data.redirectPath));
};
const importKeys = async () => {
const file = fileInput?.files?.[0];
if (!file) return;
if (await importClientKeys(await file.text())) {
await upgradeSession(false);
} else {
// TODO: Error Handling
}
fileInput!.value = "";
};
onMount(async () => {
if ($clientKeyStore) {
await goto(data.redirectPath, { replaceState: true });