mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
Implement IndexedDB document auto-save (#422)
* removed all use of document indicies * -add u64 support for wasm bridge * fixed rust formating * Cleaned up FrontendDocumentState in js-messages * Tiny tweaks from code review * - moved more of closeDocumentWithConfirmation to rust - updated serde_wasm_bindgen to add feature flag * working initial auto save impl * auto save is a lifetime file * - cargo fmt - fixc error message - move document version constant * code review round 1 * generate seed for uuid in js when wasm is initialized * Resolve PR feedback * Further address PR feedback * Fix failing test Co-authored-by: Keavon Chambers <keavon@keavon.com> Co-authored-by: otdavies <oliver@psyfer.io>
This commit is contained in:
@@ -10,7 +10,12 @@ let wasmImport: WasmInstance | null = null;
|
||||
export async function initWasm() {
|
||||
if (wasmImport !== null) return;
|
||||
|
||||
wasmImport = await import("@/../wasm/pkg").then(panicProxy);
|
||||
// Separating in two lines satisfies typescript when used below
|
||||
const importedWasm = await import("@/../wasm/pkg").then(panicProxy);
|
||||
wasmImport = importedWasm;
|
||||
|
||||
const randomSeed = BigInt(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER));
|
||||
importedWasm.set_random_seed(randomSeed);
|
||||
}
|
||||
|
||||
// This works by proxying every function call wrapping a try-catch block to filter out redundant and confusing
|
||||
|
||||
Reference in New Issue
Block a user