Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Apr 27, 2023
1 parent 6c45afe commit a06ae82
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/background/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,24 @@ async function executeApi(session, port, config) {
}

Browser.runtime.onMessage.addListener(async (message) => {
let token
switch (message.type) {
case 'FEEDBACK':
token = await getChatGptAccessToken()
case 'FEEDBACK': {
const token = await getChatGptAccessToken()
await sendMessageFeedback(token, message.data)
break
case 'DELETE_CONVERSATION':
token = await getChatGptAccessToken()
}
case 'DELETE_CONVERSATION': {
const token = await getChatGptAccessToken()
await deleteConversation(token, message.data.conversationId)
break
}
case 'OPEN_URL':
openUrl(message.data.url)
break
case 'REFRESH_MENU':
refreshMenu()
break
case 'PIN_TAB':
case 'PIN_TAB': {
let tabId
if (message.data.tabId) tabId = message.data.tabId
else {
Expand All @@ -132,6 +133,7 @@ Browser.runtime.onMessage.addListener(async (message) => {
if (message.data.saveAsChatgptConfig) await setUserConfig({ chatgptTabId: tabId })
}
break
}
}
})

Expand Down

0 comments on commit a06ae82

Please sign in to comment.