From 0bcf6336b9a18cd48a698eb21e9b7798723b9942 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Thu, 29 Jun 2023 07:38:28 +0900 Subject: [PATCH] [fix] hypamemory save order --- src/ts/process/memory/supaMemory.ts | 2 +- src/ts/storage/autoStorage.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ts/process/memory/supaMemory.ts b/src/ts/process/memory/supaMemory.ts index a46b3dc1..e1f5351e 100644 --- a/src/ts/process/memory/supaMemory.ts +++ b/src/ts/process/memory/supaMemory.ts @@ -332,7 +332,7 @@ export async function supaMemory( HypaData[0].supa = supaMemory } else{ - HypaData.push({ + HypaData.unshift({ id: lastId, hypa: hypaChunks, supa: supaMemory diff --git a/src/ts/storage/autoStorage.ts b/src/ts/storage/autoStorage.ts index 77761c5b..34f67e4b 100644 --- a/src/ts/storage/autoStorage.ts +++ b/src/ts/storage/autoStorage.ts @@ -34,7 +34,9 @@ export class AutoStorage{ this.realStorage = new NodeStorage() return } - else if(window.navigator?.storage?.getDirectory && localStorage.getItem('opfs_flag!') === "able"){ + else if(window.navigator?.storage?.getDirectory && + FileSystemFileHandle?.prototype?.createWritable && + localStorage.getItem('opfs_flag!') === "able"){ console.log("using opfs storage") const forage = localforage.createInstance({