prompts are now working from local storage. see #129
This commit is contained in:
parent
5004b2ee82
commit
2aa692c872
1 changed files with 4 additions and 4 deletions
|
|
@ -197,7 +197,7 @@ export async function preparePromptsForImport(prompts){
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getDefaultPrompts_withProps() {
|
async function getDefaultPrompts_withProps() {
|
||||||
let prefs = await browser.storage.sync.get({_default_prompts_properties: null}); //production
|
let prefs = await browser.storage.local.get({_default_prompts_properties: null}); //production
|
||||||
let defaultPrompts_prop = [...defaultPrompts];
|
let defaultPrompts_prop = [...defaultPrompts];
|
||||||
if(prefs._default_prompts_properties === null){ // no default prompts properties saved
|
if(prefs._default_prompts_properties === null){ // no default prompts properties saved
|
||||||
let pos = 1;
|
let pos = 1;
|
||||||
|
|
@ -227,7 +227,7 @@ async function getDefaultPrompts_withProps() {
|
||||||
|
|
||||||
|
|
||||||
async function getCustomPrompts() {
|
async function getCustomPrompts() {
|
||||||
let prefs = await browser.storage.sync.get({_custom_prompt: null});
|
let prefs = await browser.storage.local.get({_custom_prompt: null});
|
||||||
if(prefs._custom_prompt === null){
|
if(prefs._custom_prompt === null){
|
||||||
return [];
|
return [];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -241,11 +241,11 @@ export async function setDefaultPromptsProperties(prompts) {
|
||||||
default_prompts_properties[prompt.id] = {position_compose: prompt.position_compose, position_display: prompt.position_display, enabled: prompt.enabled};
|
default_prompts_properties[prompt.id] = {position_compose: prompt.position_compose, position_display: prompt.position_display, enabled: prompt.enabled};
|
||||||
});
|
});
|
||||||
//console.log('>>>>>>>>>>>>>> default_prompts_properties: ' + JSON.stringify(default_prompts_properties));
|
//console.log('>>>>>>>>>>>>>> default_prompts_properties: ' + JSON.stringify(default_prompts_properties));
|
||||||
await browser.storage.sync.set({_default_prompts_properties: default_prompts_properties});
|
await browser.storage.local.set({_default_prompts_properties: default_prompts_properties});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function setCustomPrompts(prompts) {
|
export async function setCustomPrompts(prompts) {
|
||||||
await browser.storage.sync.set({_custom_prompt: prompts});
|
await browser.storage.local.set({_custom_prompt: prompts});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue