fix missing local storage key
This commit is contained in:
parent
f0f2864b33
commit
dd54ec4186
|
@ -14,7 +14,11 @@ export async function loadScriptStorage(toAccount: boolean, scriptData: ScriptDa
|
||||||
value = await api('i/registry/get', { scope: ['client', 'aiscript', scriptData.type, scriptData.id!], key: key });
|
value = await api('i/registry/get', { scope: ['client', 'aiscript', scriptData.type, scriptData.id!], key: key });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (scriptData.type === 'widget') {
|
||||||
value = miLocalStorage.getItem(`aiscript:${scriptData.type}:${key}`);
|
value = miLocalStorage.getItem(`aiscript:${scriptData.type}:${key}`);
|
||||||
|
} else {
|
||||||
|
value = miLocalStorage.getItem(`aiscript:${scriptData.type}:${scriptData.id!}:${key}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value === null) return null;
|
if (value === null) return null;
|
||||||
|
@ -30,6 +34,10 @@ export async function saveScriptStorage(toAccount: boolean, scriptData: ScriptDa
|
||||||
await api('i/registry/set', { scope: ['client', 'aiscript', scriptData.type, scriptData.id!], key: key, value: jsonValue });
|
await api('i/registry/set', { scope: ['client', 'aiscript', scriptData.type, scriptData.id!], key: key, value: jsonValue });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (scriptData.type === 'widget') {
|
||||||
miLocalStorage.setItem(`aiscript:${scriptData.type}:${key}`, jsonValue);
|
miLocalStorage.setItem(`aiscript:${scriptData.type}:${key}`, jsonValue);
|
||||||
|
} else {
|
||||||
|
miLocalStorage.setItem(`aiscript:${scriptData.type}:${scriptData.id!}:${key}`, jsonValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue