perf(web-db): stop re-encrypting records on read
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import { localDb, type LocalTaskDraftRecord } from "@/services/local-db";
|
||||
import {
|
||||
decryptTaskDraftRecord,
|
||||
encryptTaskDraftRecord,
|
||||
shouldEncryptTaskDraft
|
||||
} from "@/services/local-sensitive-codec";
|
||||
import { decryptTaskDraftRecord, encryptTaskDraftRecord } from "@/services/local-sensitive-codec";
|
||||
|
||||
export type SaveLocalTaskDraftInput = {
|
||||
taskId: string;
|
||||
@@ -22,10 +18,6 @@ export async function getLocalTaskDraft(taskId: string): Promise<LocalTaskDraftR
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (shouldEncryptTaskDraft(draft)) {
|
||||
await localDb.taskDrafts.put(await encryptTaskDraftRecord(draft));
|
||||
}
|
||||
|
||||
return decryptTaskDraftRecord(draft);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user