Add getLocalPrompt and setLocalPrompt functions to preferenceApi.ts

This commit is contained in:
Alex
2023-12-04 11:23:51 +02:00
parent 453e507b89
commit f8f60c62fe
3 changed files with 24 additions and 1 deletions

View File

@@ -66,10 +66,19 @@ export function getLocalRecentDocs(): string | null {
return doc;
}
export function getLocalPrompt(): string | null {
const prompt = localStorage.getItem('DocsGPTPrompt');
return prompt;
}
export function setLocalApiKey(key: string): void {
localStorage.setItem('DocsGPTApiKey', key);
}
export function setLocalPrompt(prompt: string): void {
localStorage.setItem('DocsGPTPrompt', prompt);
}
export function setLocalRecentDocs(doc: Doc): void {
localStorage.setItem('DocsGPTRecentDocs', JSON.stringify(doc));
let namePath = doc.name;