Skip to content

Commit 0f4b669

Browse files
committed
~fix bug with getCurrentPrompt() on fresh install
1 parent 290c794 commit 0f4b669

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "__MSG_appName__",
44
"description": "__MSG_appDesc__",
55
"default_locale": "en",
6-
"version": "2.0.1",
6+
"version": "2.0.2",
77
"icons": {
88
"16": "icons/icon16.png",
99
"48": "icons/icon48.png",

src/manifest.v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "__MSG_appName__",
44
"description": "__MSG_appDesc__",
55
"default_locale": "en",
6-
"version": "2.0.1",
6+
"version": "2.0.2",
77
"icons": {
88
"16": "icons/icon16.png",
99
"48": "icons/icon48.png",

src/util/promptManager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SearchResult } from "src/content-scripts/api"
22
import Browser from "webextension-polyfill"
33
import { v4 as uuidv4 } from 'uuid'
44
import { getCurrentLanguageName, getLocaleLanguage, getTranslation, localizationKeys } from "./localization"
5+
import { getUserConfig } from "./userConfig"
56

67
export const DEFAULT_PROMPT_KEY = 'default_prompt'
78
export const CURRENT_PROMPT_UUID_KEY = 'promptUUID'
@@ -56,8 +57,8 @@ const getDefaultEnglishPrompt = () => {
5657
}
5758

5859
export const getCurrentPrompt = async () => {
59-
const data = await Browser.storage.sync.get()
60-
const currentPromptUuid = data[CURRENT_PROMPT_UUID_KEY]
60+
const userConfig = await getUserConfig()
61+
const currentPromptUuid = userConfig.promptUUID
6162
const savedPrompts = await getSavedPrompts()
6263
return savedPrompts.find((i: Prompt) => i.uuid === currentPromptUuid)
6364
}

0 commit comments

Comments
 (0)