diff --git a/packages/client/src/core.ts b/packages/client/src/core.ts index 7fbe9283c..56ca4cbd8 100644 --- a/packages/client/src/core.ts +++ b/packages/client/src/core.ts @@ -55,8 +55,8 @@ export type Procedures = { { key: "keys.mount", input: LibraryArgs, result: null } | { key: "keys.restoreKeystore", input: LibraryArgs, result: number } | { key: "keys.setDefault", input: LibraryArgs, result: null } | - { key: "keys.setMasterPassword", input: LibraryArgs, result: null } | { key: "keys.syncKeyToLibrary", input: LibraryArgs, result: null } | + { key: "keys.unlockKeyManager", input: LibraryArgs, result: null } | { key: "keys.unmount", input: LibraryArgs, result: null } | { key: "keys.unmountAll", input: LibraryArgs, result: null } | { key: "keys.updateAutomountStatus", input: LibraryArgs, result: null } | @@ -177,8 +177,6 @@ export type RuleKind = "AcceptFilesByGlob" | "RejectFilesByGlob" | "AcceptIfChil export interface SetFavoriteArgs { id: number, favorite: boolean } -export interface SetMasterPasswordArgs { password: string, secret_key: string | null } - export interface SetNoteArgs { id: number, note: string | null } export interface Statistics { id: number, date_captured: string, total_object_count: number, library_db_size: string, total_bytes_used: string, total_bytes_capacity: string, total_unique_bytes: string, total_bytes_free: string, preview_media_bytes: string } @@ -195,6 +193,8 @@ export interface TagCreateArgs { name: string, color: string } export interface TagUpdateArgs { id: number, name: string | null, color: string | null } +export interface UnlockKeyManagerArgs { password: string, secret_key: string | null } + export interface Volume { name: string, mount_point: string, total_capacity: bigint, available_capacity: bigint, is_removable: boolean, disk_type: string | null, file_system: string | null, is_root_filesystem: boolean } export interface FilePathWithObject { id: number, is_dir: boolean, location_id: number, materialized_path: string, name: string, extension: string | null, object_id: number | null, parent_id: number | null, key_id: number | null, date_created: string, date_modified: string, date_indexed: string, object: Object | null } diff --git a/packages/interface/src/components/key/KeyManager.tsx b/packages/interface/src/components/key/KeyManager.tsx index e9d594b8b..13b4b52e5 100644 --- a/packages/interface/src/components/key/KeyManager.tsx +++ b/packages/interface/src/components/key/KeyManager.tsx @@ -11,7 +11,7 @@ export type KeyManagerProps = DefaultProps; export function KeyManager(props: KeyManagerProps) { const hasMasterPw = useLibraryQuery(['keys.hasMasterPassword']); const isKeyManagerUnlocking = useLibraryQuery(['keys.isKeyManagerUnlocking']); - const setMasterPasswordMutation = useLibraryMutation('keys.setMasterPassword', { + const setMasterPasswordMutation = useLibraryMutation('keys.unlockKeyManager', { onError: () => { alert('Incorrect information provided.'); } diff --git a/packages/interface/src/screens/settings/library/KeysSetting.tsx b/packages/interface/src/screens/settings/library/KeysSetting.tsx index c4c828c49..d0ef16870 100644 --- a/packages/interface/src/screens/settings/library/KeysSetting.tsx +++ b/packages/interface/src/screens/settings/library/KeysSetting.tsx @@ -76,7 +76,7 @@ export const KeyMounterDropdown = ({ export default function KeysSettings() { const platform = usePlatform(); const hasMasterPw = useLibraryQuery(['keys.hasMasterPassword']); - const setMasterPasswordMutation = useLibraryMutation('keys.setMasterPassword', { + const setMasterPasswordMutation = useLibraryMutation('keys.unlockKeyManager', { onError: () => { showAlertDialog({ title: 'Unlock Error',