diff --git a/manifest.json b/manifest.json index 5215d34..8d35cd5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-livesync", "name": "Self-hosted LiveSync", - "version": "0.25.70", + "version": "0.25.70-patch1", "minAppVersion": "1.7.2", "description": "Community implementation of self-hosted livesync. Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", "author": "vorotamoroz", diff --git a/package-lock.json b/package-lock.json index eb84601..901d523 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidian-livesync", - "version": "0.25.70", + "version": "0.25.70-patch1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "obsidian-livesync", - "version": "0.25.70", + "version": "0.25.70-patch1", "license": "MIT", "dependencies": { "@aws-sdk/client-s3": "^3.808.0", diff --git a/package.json b/package.json index 6700e33..d3677ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-livesync", - "version": "0.25.70", + "version": "0.25.70-patch1", "description": "Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", "main": "main.js", "type": "module", @@ -25,7 +25,7 @@ "pretty": "npm run prettyNoWrite -- --write --log-level error", "prettyCheck": "npm run prettyNoWrite -- --check", "prettyNoWrite": "prettier --config ./.prettierrc.mjs \"**/*.js\" \"**/*.ts\" \"**/*.json\" ", - "check": "npm run lint && npm run svelte-check", + "check": "npm run tsc-check && npm run lint && npm run svelte-check", "unittest": "deno test -A --no-check --coverage=cov_profile --v8-flags=--expose-gc --trace-leaks ./src/", "test": "vitest run", "test:unit": "vitest run --config vitest.config.unit.ts", diff --git a/src/modules/features/SetupManager.ts b/src/modules/features/SetupManager.ts index 02f19d6..890a2cf 100644 --- a/src/modules/features/SetupManager.ts +++ b/src/modules/features/SetupManager.ts @@ -1,12 +1,16 @@ import { + type BucketSyncSetting, + type CouchDBConnection, + type EncryptionSettings, type ObsidianLiveSyncSettings, + type P2PSyncSetting, DEFAULT_SETTINGS, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE, REMOTE_COUCHDB, REMOTE_MINIO, REMOTE_P2P, -} from "../../lib/src/common/types.ts"; +} from "@lib/common/types.ts"; import { isObjectDifferent } from "@lib/common/utils.ts"; import Intro from "./SetupWizard/dialogs/Intro.svelte"; import SelectMethodNewUser from "./SetupWizard/dialogs/SelectMethodNewUser.svelte"; @@ -21,9 +25,21 @@ import SetupRemoteCouchDB from "./SetupWizard/dialogs/SetupRemoteCouchDB.svelte" import SetupRemoteBucket from "./SetupWizard/dialogs/SetupRemoteBucket.svelte"; import SetupRemoteP2P from "./SetupWizard/dialogs/SetupRemoteP2P.svelte"; import SetupRemoteE2EE from "./SetupWizard/dialogs/SetupRemoteE2EE.svelte"; -import { decodeSettingsFromQRCodeData } from "../../lib/src/API/processSetting.ts"; +import { decodeSettingsFromQRCodeData } from "@lib/API/processSetting.ts"; import { AbstractModule } from "../AbstractModule.ts"; import { ConnectionStringParser } from "@lib/common/ConnectionString.ts"; +import type { + OutroAskUserModeResultType, + OutroExistingUserResultType, + OutroNewUserResultType, + ScanQRCodeResultType, + SetupRemoteBucketResultType, + SetupRemoteCouchDBResultType, + SetupRemoteE2EEResultType, + SetupRemoteP2PResultType, + SetupRemoteResultType, + UseSetupURIResultType, +} from "./SetupWizard/dialogs/setupDialogTypes.ts"; /** * User modes for onboarding and setup @@ -118,7 +134,10 @@ export class SetupManager extends AbstractModule { * @returns Promise that resolves to true if onboarding completed successfully, false otherwise */ async onUseSetupURI(userMode: UserMode, setupURI: string = ""): Promise { - const newSetting = await this.dialogManager.openWithExplicitCancel(UseSetupURI, setupURI); + const newSetting = await this.dialogManager.openWithExplicitCancel( + UseSetupURI, + setupURI + ); if (newSetting === "cancelled") { this._log("Setup URI dialog cancelled.", LOG_LEVEL_NOTICE); return false; @@ -141,7 +160,10 @@ export class SetupManager extends AbstractModule { ): Promise { const originalSetting = JSON.parse(JSON.stringify(currentSetting)) as ObsidianLiveSyncSettings; const baseSetting = JSON.parse(JSON.stringify(originalSetting)) as ObsidianLiveSyncSettings; - const couchConf = await this.dialogManager.openWithExplicitCancel(SetupRemoteCouchDB, originalSetting); + const couchConf = await this.dialogManager.openWithExplicitCancel< + SetupRemoteCouchDBResultType, + CouchDBConnection + >(SetupRemoteCouchDB, originalSetting); if (couchConf === "cancelled") { this._log("Manual configuration cancelled.", LOG_LEVEL_NOTICE); return await this.onOnboard(userMode); @@ -165,7 +187,10 @@ export class SetupManager extends AbstractModule { currentSetting: ObsidianLiveSyncSettings, activate = true ): Promise { - const bucketConf = await this.dialogManager.openWithExplicitCancel(SetupRemoteBucket, currentSetting); + const bucketConf = await this.dialogManager.openWithExplicitCancel< + SetupRemoteBucketResultType, + BucketSyncSetting + >(SetupRemoteBucket, currentSetting); if (bucketConf === "cancelled") { this._log("Manual configuration cancelled.", LOG_LEVEL_NOTICE); return await this.onOnboard(userMode); @@ -189,7 +214,10 @@ export class SetupManager extends AbstractModule { currentSetting: ObsidianLiveSyncSettings, activate = true ): Promise { - const p2pConf = await this.dialogManager.openWithExplicitCancel(SetupRemoteP2P, currentSetting); + const p2pConf = await this.dialogManager.openWithExplicitCancel( + SetupRemoteP2P, + currentSetting + ); if (p2pConf === "cancelled") { this._log("Manual configuration cancelled.", LOG_LEVEL_NOTICE); return await this.onOnboard(userMode); @@ -224,7 +252,10 @@ export class SetupManager extends AbstractModule { * @returns */ async onlyE2EEConfiguration(userMode: UserMode, currentSetting: ObsidianLiveSyncSettings): Promise { - const e2eeConf = await this.dialogManager.openWithExplicitCancel(SetupRemoteE2EE, currentSetting); + const e2eeConf = await this.dialogManager.openWithExplicitCancel( + SetupRemoteE2EE, + currentSetting + ); if (e2eeConf === "cancelled") { this._log("E2EE configuration cancelled.", LOG_LEVEL_NOTICE); return false; @@ -243,7 +274,10 @@ export class SetupManager extends AbstractModule { * @returns */ async onConfigureManually(originalSetting: ObsidianLiveSyncSettings, userMode: UserMode): Promise { - const e2eeConf = await this.dialogManager.openWithExplicitCancel(SetupRemoteE2EE, originalSetting); + const e2eeConf = await this.dialogManager.openWithExplicitCancel( + SetupRemoteE2EE, + originalSetting + ); if (e2eeConf === "cancelled") { this._log("Manual configuration cancelled.", LOG_LEVEL_NOTICE); return await this.onOnboard(userMode); @@ -262,7 +296,7 @@ export class SetupManager extends AbstractModule { * @returns */ async onSelectServer(currentSetting: ObsidianLiveSyncSettings, userMode: UserMode): Promise { - const method = await this.dialogManager.openWithExplicitCancel(SetupRemote); + const method = await this.dialogManager.openWithExplicitCancel(SetupRemote); if (method === "couchdb") { return await this.onCouchDBManualSetup(userMode, currentSetting, true); } else if (method === "bucket") { @@ -321,7 +355,8 @@ export class SetupManager extends AbstractModule { this._log("Settings from wizard applied.", LOG_LEVEL_NOTICE); return true; } else { - const userModeResult = await this.dialogManager.openWithExplicitCancel(OutroAskUserMode); + const userModeResult = + await this.dialogManager.openWithExplicitCancel(OutroAskUserMode); if (userModeResult === "new-user") { userMode = UserMode.NewUser; } else if (userModeResult === "existing-user") { @@ -338,7 +373,9 @@ export class SetupManager extends AbstractModule { } } const component = userMode === UserMode.NewUser ? OutroNewUser : OutroExistingUser; - const confirm = await this.dialogManager.openWithExplicitCancel(component); + const confirm = await this.dialogManager.openWithExplicitCancel< + OutroNewUserResultType | OutroExistingUserResultType + >(component); if (confirm === "cancelled") { this._log("User cancelled applying settings from wizard..", LOG_LEVEL_NOTICE); return false; @@ -364,7 +401,7 @@ export class SetupManager extends AbstractModule { */ async onPromptQRCodeInstruction(): Promise { - const qrResult = await this.dialogManager.open(ScanQRCode); + const qrResult = await this.dialogManager.open(ScanQRCode); this._log("QR Code dialog closed.", LOG_LEVEL_VERBOSE); // Result is not used, but log it for debugging. this._log(qrResult, LOG_LEVEL_VERBOSE); diff --git a/src/modules/features/SetupWizard/dialogs/FetchEverything.svelte b/src/modules/features/SetupWizard/dialogs/FetchEverything.svelte index e704782..9bb06d7 100644 --- a/src/modules/features/SetupWizard/dialogs/FetchEverything.svelte +++ b/src/modules/features/SetupWizard/dialogs/FetchEverything.svelte @@ -1,47 +1,30 @@ diff --git a/src/modules/features/SetupWizard/dialogs/OutroNewUser.svelte b/src/modules/features/SetupWizard/dialogs/OutroNewUser.svelte index ff39c62..3818a29 100644 --- a/src/modules/features/SetupWizard/dialogs/OutroNewUser.svelte +++ b/src/modules/features/SetupWizard/dialogs/OutroNewUser.svelte @@ -5,14 +5,13 @@ import Question from "@/lib/src/UI/components/Question.svelte"; import Instruction from "@/lib/src/UI/components/Instruction.svelte"; import UserDecisions from "@/lib/src/UI/components/UserDecisions.svelte"; - const TYPE_APPLY = "apply"; - const TYPE_CANCELLED = "cancelled"; - type ResultType = typeof TYPE_APPLY | typeof TYPE_CANCELLED; + import { TYPE_APPLY, TYPE_CANCELLED, type OutroNewUserResultType } from "./setupDialogTypes"; + type Props = { - setResult: (result: ResultType) => void; + setResult: (result: OutroNewUserResultType) => void; }; const { setResult }: Props = $props(); - // let userType = $state(TYPE_CANCELLED); + // let userType = $state(TYPE_CANCELLED); diff --git a/src/modules/features/SetupWizard/dialogs/PanelCouchDBCheck.svelte b/src/modules/features/SetupWizard/dialogs/PanelCouchDBCheck.svelte index d2cef32..4ac0f85 100644 --- a/src/modules/features/SetupWizard/dialogs/PanelCouchDBCheck.svelte +++ b/src/modules/features/SetupWizard/dialogs/PanelCouchDBCheck.svelte @@ -2,9 +2,9 @@ /** * Panel to check and fix CouchDB configuration issues */ - import type { ObsidianLiveSyncSettings } from "../../../../lib/src/common/types"; - import Decision from "../../../../lib/src/UI/components/Decision.svelte"; - import UserDecisions from "../../../../lib/src/UI/components/UserDecisions.svelte"; + import type { ObsidianLiveSyncSettings } from "@lib/common/types"; + import Decision from "@lib/UI/components/Decision.svelte"; + import UserDecisions from "@lib/UI/components/UserDecisions.svelte"; import { checkConfig, type ConfigCheckResult, type ResultError, type ResultErrorMessage } from "./utilCheckCouchDB"; type Props = { trialRemoteSetting: ObsidianLiveSyncSettings; diff --git a/src/modules/features/SetupWizard/dialogs/RebuildEverything.svelte b/src/modules/features/SetupWizard/dialogs/RebuildEverything.svelte index 93aa834..1fe06e3 100644 --- a/src/modules/features/SetupWizard/dialogs/RebuildEverything.svelte +++ b/src/modules/features/SetupWizard/dialogs/RebuildEverything.svelte @@ -10,29 +10,17 @@ import InfoNote from "@/lib/src/UI/components/InfoNote.svelte"; import ExtraItems from "@/lib/src/UI/components/ExtraItems.svelte"; import Check from "@/lib/src/UI/components/Check.svelte"; - const TYPE_CANCEL = "cancelled"; + import { + TYPE_CANCEL, + TYPE_BACKUP_DONE, + TYPE_BACKUP_SKIPPED, + TYPE_UNABLE_TO_BACKUP, + type RebuildEverythingResult, + type ResultTypeBackup, + } from "./setupDialogTypes"; - const TYPE_BACKUP_DONE = "backup_done"; - const TYPE_BACKUP_SKIPPED = "backup_skipped"; - const TYPE_UNABLE_TO_BACKUP = "unable_to_backup"; - - type ResultTypeBackup = - | typeof TYPE_BACKUP_DONE - | typeof TYPE_BACKUP_SKIPPED - | typeof TYPE_UNABLE_TO_BACKUP - | typeof TYPE_CANCEL; - - type ResultTypeExtra = { - preventFetchingConfig: boolean; - }; - type ResultType = - | { - backup: ResultTypeBackup; - extra: ResultTypeExtra; - } - | typeof TYPE_CANCEL; type Props = { - setResult: (result: ResultType) => void; + setResult: (result: RebuildEverythingResult) => void; }; const { setResult }: Props = $props(); diff --git a/src/modules/features/SetupWizard/dialogs/ScanQRCode.svelte b/src/modules/features/SetupWizard/dialogs/ScanQRCode.svelte index 57c0621..4a24f46 100644 --- a/src/modules/features/SetupWizard/dialogs/ScanQRCode.svelte +++ b/src/modules/features/SetupWizard/dialogs/ScanQRCode.svelte @@ -4,10 +4,10 @@ import Decision from "@/lib/src/UI/components/Decision.svelte"; import Instruction from "@/lib/src/UI/components/Instruction.svelte"; import UserDecisions from "@/lib/src/UI/components/UserDecisions.svelte"; - const TYPE_CLOSE = "close"; - type ResultType = typeof TYPE_CLOSE; + import { TYPE_CLOSE, type ScanQRCodeResultType } from "./setupDialogTypes"; + type Props = { - setResult: (_result: ResultType) => void; + setResult: (_result: ScanQRCodeResultType) => void; }; const { setResult }: Props = $props(); diff --git a/src/modules/features/SetupWizard/dialogs/SelectMethodExisting.svelte b/src/modules/features/SetupWizard/dialogs/SelectMethodExisting.svelte index 8c72ffb..982d60c 100644 --- a/src/modules/features/SetupWizard/dialogs/SelectMethodExisting.svelte +++ b/src/modules/features/SetupWizard/dialogs/SelectMethodExisting.svelte @@ -7,16 +7,19 @@ import Options from "@/lib/src/UI/components/Options.svelte"; import Instruction from "@/lib/src/UI/components/Instruction.svelte"; import UserDecisions from "@/lib/src/UI/components/UserDecisions.svelte"; - const TYPE_USE_SETUP_URI = "use-setup-uri"; - const TYPE_SCAN_QR_CODE = "scan-qr-code"; - const TYPE_CONFIGURE_MANUALLY = "configure-manually"; - const TYPE_CANCELLED = "cancelled"; - type ResultType = typeof TYPE_USE_SETUP_URI | typeof TYPE_SCAN_QR_CODE | typeof TYPE_CONFIGURE_MANUALLY | typeof TYPE_CANCELLED; + import { + TYPE_USE_SETUP_URI, + TYPE_SCAN_QR_CODE, + TYPE_CONFIGURE_MANUALLY, + TYPE_CANCELLED, + type SelectMethodExistingResultType, + } from "./setupDialogTypes"; + type Props = { - setResult: (result: ResultType) => void; + setResult: (result: SelectMethodExistingResultType) => void; }; const { setResult }: Props = $props(); - let userType = $state(TYPE_CANCELLED); + let userType = $state(TYPE_CANCELLED); let proceedTitle = $derived.by(() => { if (userType === TYPE_USE_SETUP_URI) { return "Proceed with Setup URI"; diff --git a/src/modules/features/SetupWizard/dialogs/SelectMethodNewUser.svelte b/src/modules/features/SetupWizard/dialogs/SelectMethodNewUser.svelte index 88a6aed..36e90fc 100644 --- a/src/modules/features/SetupWizard/dialogs/SelectMethodNewUser.svelte +++ b/src/modules/features/SetupWizard/dialogs/SelectMethodNewUser.svelte @@ -7,15 +7,18 @@ import Options from "@/lib/src/UI/components/Options.svelte"; import Instruction from "@/lib/src/UI/components/Instruction.svelte"; import UserDecisions from "@/lib/src/UI/components/UserDecisions.svelte"; - const TYPE_USE_SETUP_URI = "use-setup-uri"; - const TYPE_CONFIGURE_MANUALLY = "configure-manually"; - const TYPE_CANCELLED = "cancelled"; - type ResultType = typeof TYPE_USE_SETUP_URI | typeof TYPE_CONFIGURE_MANUALLY | typeof TYPE_CANCELLED; + import { + TYPE_USE_SETUP_URI, + TYPE_CONFIGURE_MANUALLY, + TYPE_CANCELLED, + type SelectMethodNewUserResultType, + } from "./setupDialogTypes"; + type Props = { - setResult: (result: ResultType) => void; + setResult: (result: SelectMethodNewUserResultType) => void; }; const { setResult }: Props = $props(); - let userType = $state(TYPE_CANCELLED); + let userType = $state(TYPE_CANCELLED); let proceedTitle = $derived.by(() => { if (userType === TYPE_USE_SETUP_URI) { return "Proceed with Setup URI"; diff --git a/src/modules/features/SetupWizard/dialogs/SetupRemote.svelte b/src/modules/features/SetupWizard/dialogs/SetupRemote.svelte index adcb87a..365f117 100644 --- a/src/modules/features/SetupWizard/dialogs/SetupRemote.svelte +++ b/src/modules/features/SetupWizard/dialogs/SetupRemote.svelte @@ -6,16 +6,19 @@ import Options from "@/lib/src/UI/components/Options.svelte"; import Instruction from "@/lib/src/UI/components/Instruction.svelte"; import UserDecisions from "@/lib/src/UI/components/UserDecisions.svelte"; - const TYPE_COUCHDB = "couchdb"; - const TYPE_BUCKET = "bucket"; - const TYPE_P2P = "p2p"; - const TYPE_CANCELLED = "cancelled"; - type ResultType = typeof TYPE_COUCHDB | typeof TYPE_BUCKET | typeof TYPE_P2P | typeof TYPE_CANCELLED; + import { + TYPE_COUCHDB, + TYPE_BUCKET, + TYPE_P2P, + TYPE_CANCELLED, + type SetupRemoteResultType, + } from "./setupDialogTypes"; + type Props = { - setResult: (result: ResultType) => void; + setResult: (result: SetupRemoteResultType) => void; }; const { setResult }: Props = $props(); - let userType = $state(TYPE_CANCELLED); + let userType = $state(TYPE_CANCELLED); let proceedTitle = $derived.by(() => { if (userType === TYPE_COUCHDB) { return "Continue to CouchDB setup"; diff --git a/src/modules/features/SetupWizard/dialogs/SetupRemoteBucket.svelte b/src/modules/features/SetupWizard/dialogs/SetupRemoteBucket.svelte index f2270dc..7c04c38 100644 --- a/src/modules/features/SetupWizard/dialogs/SetupRemoteBucket.svelte +++ b/src/modules/features/SetupWizard/dialogs/SetupRemoteBucket.svelte @@ -13,19 +13,18 @@ DEFAULT_SETTINGS, PREFERRED_JOURNAL_SYNC, RemoteTypes, - } from "../../../../lib/src/common/types"; + } from "@lib/common/types"; import { onMount } from "svelte"; - import { getDialogContext, type GuestDialogProps } from "../../../../lib/src/UI/svelteDialog"; - import { copyTo, pickBucketSyncSettings } from "../../../../lib/src/common/utils"; + import { getDialogContext, type GuestDialogProps } from "@lib/UI/svelteDialog"; + import { copyTo, pickBucketSyncSettings } from "@lib/common/utils"; + import { TYPE_CANCELLED, type SetupRemoteBucketResultType } from "./setupDialogTypes"; const default_setting = pickBucketSyncSettings(DEFAULT_SETTINGS); let syncSetting = $state({ ...default_setting }); - type ResultType = typeof TYPE_CANCELLED | BucketSyncSetting; - type Props = GuestDialogProps; - const TYPE_CANCELLED = "cancelled"; + type Props = GuestDialogProps; const { setResult, getInitialData }: Props = $props(); diff --git a/src/modules/features/SetupWizard/dialogs/SetupRemoteCouchDB.svelte b/src/modules/features/SetupWizard/dialogs/SetupRemoteCouchDB.svelte index 671af71..be18b75 100644 --- a/src/modules/features/SetupWizard/dialogs/SetupRemoteCouchDB.svelte +++ b/src/modules/features/SetupWizard/dialogs/SetupRemoteCouchDB.svelte @@ -14,20 +14,19 @@ RemoteTypes, type CouchDBConnection, type ObsidianLiveSyncSettings, - } from "../../../../lib/src/common/types"; - import { isCloudantURI } from "../../../../lib/src/pouchdb/utils_couchdb"; + } from "@lib/common/types"; + import { isCloudantURI } from "@lib/pouchdb/utils_couchdb"; import { onMount } from "svelte"; - import { getDialogContext, type GuestDialogProps } from "../../../../lib/src/UI/svelteDialog"; - import { copyTo, pickCouchDBSyncSettings } from "../../../../lib/src/common/utils"; + import { getDialogContext, type GuestDialogProps } from "@lib/UI/svelteDialog"; + import { copyTo, pickCouchDBSyncSettings } from "@lib/common/utils"; import PanelCouchDBCheck from "./PanelCouchDBCheck.svelte"; + import { TYPE_CANCELLED, type SetupRemoteCouchDBResultType } from "./setupDialogTypes"; const default_setting = pickCouchDBSyncSettings(DEFAULT_SETTINGS); let syncSetting = $state({ ...default_setting }); - type ResultType = typeof TYPE_CANCELLED | CouchDBConnection; - const TYPE_CANCELLED = "cancelled"; - type Props = GuestDialogProps; + type Props = GuestDialogProps; const { setResult, getInitialData }: Props = $props(); onMount(() => { if (getInitialData) { diff --git a/src/modules/features/SetupWizard/dialogs/SetupRemoteE2EE.svelte b/src/modules/features/SetupWizard/dialogs/SetupRemoteE2EE.svelte index 052e97d..f3c40ed 100644 --- a/src/modules/features/SetupWizard/dialogs/SetupRemoteE2EE.svelte +++ b/src/modules/features/SetupWizard/dialogs/SetupRemoteE2EE.svelte @@ -12,13 +12,13 @@ E2EEAlgorithmNames, E2EEAlgorithms, type EncryptionSettings, - } from "../../../../lib/src/common/types"; + } from "@lib/common/types"; import { onMount } from "svelte"; - import type { GuestDialogProps } from "../../../../lib/src/UI/svelteDialog"; - import { copyTo, pickEncryptionSettings } from "../../../../lib/src/common/utils"; - const TYPE_CANCELLED = "cancelled"; - type ResultType = typeof TYPE_CANCELLED | EncryptionSettings; - type Props = GuestDialogProps; + import type { GuestDialogProps } from "@lib/UI/svelteDialog"; + import { copyTo, pickEncryptionSettings } from "@lib/common/utils"; + import { TYPE_CANCELLED, type SetupRemoteE2EEResultType } from "./setupDialogTypes"; + + type Props = GuestDialogProps; const { setResult, getInitialData }: Props = $props(); let default_encryption: EncryptionSettings = { encrypt: true, diff --git a/src/modules/features/SetupWizard/dialogs/SetupRemoteP2P.svelte b/src/modules/features/SetupWizard/dialogs/SetupRemoteP2P.svelte index cd2020e..4e1067a 100644 --- a/src/modules/features/SetupWizard/dialogs/SetupRemoteP2P.svelte +++ b/src/modules/features/SetupWizard/dialogs/SetupRemoteP2P.svelte @@ -26,16 +26,14 @@ import { getDialogContext, type GuestDialogProps } from "@lib/UI/svelteDialog"; import { SETTING_KEY_P2P_DEVICE_NAME } from "@lib/common/types"; import ExtraItems from "@lib/UI/components/ExtraItems.svelte"; + import { TYPE_CANCELLED, type SetupRemoteP2PResultType } from "./setupDialogTypes"; const default_setting = pickP2PSyncSettings(DEFAULT_SETTINGS); let syncSetting = $state({ ...default_setting }); const context = getDialogContext(); let error = $state(""); - const TYPE_CANCELLED = "cancelled"; - type SettingInfo = P2PConnectionInfo; - type ResultType = typeof TYPE_CANCELLED | SettingInfo; - type Props = GuestDialogProps; + type Props = GuestDialogProps; const { setResult, getInitialData }: Props = $props(); onMount(() => { diff --git a/src/modules/features/SetupWizard/dialogs/UseSetupURI.svelte b/src/modules/features/SetupWizard/dialogs/UseSetupURI.svelte index d6152b7..d1ed1ac 100644 --- a/src/modules/features/SetupWizard/dialogs/UseSetupURI.svelte +++ b/src/modules/features/SetupWizard/dialogs/UseSetupURI.svelte @@ -1,6 +1,6 @@