feat: add MiscellaneousPanel - need to implement UI
This commit is contained in:
@@ -844,5 +844,49 @@ export function forDSP408(dsp: DSP408, setDsps: SetDsps, notify: NotifyFn) {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
async unlockDevice(password: string): Promise<boolean> {
|
||||
return withPollingPaused(dsp, setDsps, async () => {
|
||||
try {
|
||||
const success = await invoke<boolean>('unlock_device', {
|
||||
id: dsp.id,
|
||||
password,
|
||||
});
|
||||
|
||||
if (!success) {
|
||||
return false;
|
||||
}
|
||||
|
||||
await updateDSPState();
|
||||
|
||||
return true;
|
||||
} catch (err) {
|
||||
notify(`Unlock failed: ${String(err)}`, 'error', dsp.name);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
async lockDevice(password: string): Promise<boolean> {
|
||||
return withPollingPaused(dsp, setDsps, async () => {
|
||||
try {
|
||||
const success = await invoke<boolean>('lock_device', {
|
||||
id: dsp.id,
|
||||
password,
|
||||
});
|
||||
|
||||
if (!success) {
|
||||
return false;
|
||||
}
|
||||
|
||||
await updateDSPState();
|
||||
|
||||
return true;
|
||||
} catch (err) {
|
||||
notify(`Lock failed: ${String(err)}`, 'error', dsp.name);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user