[feat] custom flags
This commit is contained in:
@@ -45,6 +45,15 @@
|
|||||||
<div class="flex items-center mt-4">
|
<div class="flex items-center mt-4">
|
||||||
<Check bind:check={$DataBase.usePlainFetch} name="Force Plain Fetch"/>
|
<Check bind:check={$DataBase.usePlainFetch} name="Force Plain Fetch"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex items-center mt-4">
|
||||||
|
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" placeholder="experimental flags" on:input={(e) => {
|
||||||
|
const v = e.currentTarget.value
|
||||||
|
if(v.endsWith("_flag!")){
|
||||||
|
localStorage.setItem(v, "able")
|
||||||
|
e.currentTarget.value = ""
|
||||||
|
}
|
||||||
|
}}>
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
alertMd(getRequestLog())
|
alertMd(getRequestLog())
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export class AutoStorage{
|
|||||||
this.realStorage = new NodeStorage()
|
this.realStorage = new NodeStorage()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
else if(window.navigator?.storage?.getDirectory && localStorage.getItem('flag_opfs')){
|
else if(window.navigator?.storage?.getDirectory && localStorage.getItem('opfs_flag!') === "able"){
|
||||||
console.log("using opfs storage")
|
console.log("using opfs storage")
|
||||||
|
|
||||||
const forage = localforage.createInstance({
|
const forage = localforage.createInstance({
|
||||||
@@ -53,9 +53,8 @@ export class AutoStorage{
|
|||||||
let i = 0;
|
let i = 0;
|
||||||
const opfs = new OpfsStorage()
|
const opfs = new OpfsStorage()
|
||||||
for(const key of keys){
|
for(const key of keys){
|
||||||
console.log(i)
|
|
||||||
alertStore.set({
|
alertStore.set({
|
||||||
type: "none",
|
type: "wait",
|
||||||
msg: `Migrating your data...(${i}/${keys.length})`
|
msg: `Migrating your data...(${i}/${keys.length})`
|
||||||
})
|
})
|
||||||
await opfs.setItem(key,await forage.getItem(key))
|
await opfs.setItem(key,await forage.getItem(key))
|
||||||
|
|||||||
Reference in New Issue
Block a user