fix(ConfigPanel): correct auth token storage key
This commit is contained in:
@@ -41,12 +41,13 @@ export function initPageController() {
|
||||
// await getPC().hideMask()
|
||||
if (pageController) {
|
||||
pageController.hideMask()
|
||||
pageController.cleanUpHighlights()
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAgentRunning) {
|
||||
if (pageController) {
|
||||
pageController?.dispose()
|
||||
pageController.dispose()
|
||||
pageController = null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ export default defineContentScript({
|
||||
|
||||
if (pageToken !== extToken) return
|
||||
|
||||
console.log('[PageAgentExt]: Auth tokens match. Exposing agent to page.')
|
||||
|
||||
// add isolated world script
|
||||
exposeAgentToPage().then(
|
||||
// add main-world script
|
||||
@@ -35,7 +37,7 @@ export default defineContentScript({
|
||||
|
||||
async function exposeAgentToPage() {
|
||||
const { MultiPageAgent } = await import('@/agent/MultiPageAgent')
|
||||
console.log('MultiPageAgent loaded', MultiPageAgent)
|
||||
console.log('[PageAgentExt]: MultiPageAgent loaded')
|
||||
|
||||
/**
|
||||
* singleton MultiPageAgent to handle requests from the page
|
||||
|
||||
@@ -32,8 +32,8 @@ export function ConfigPanel({ config, onSave, onClose }: ConfigPanelProps) {
|
||||
let interval: NodeJS.Timeout | null = null
|
||||
|
||||
const fetchToken = async () => {
|
||||
const result = await chrome.storage.local.get('PageAgentExtUserAuthID')
|
||||
const token = result.PageAgentExtUserAuthID
|
||||
const result = await chrome.storage.local.get('PageAgentExtUserAuthToken')
|
||||
const token = result.PageAgentExtUserAuthToken
|
||||
if (typeof token === 'string' && token) {
|
||||
setUserAuthToken(token)
|
||||
if (interval) {
|
||||
|
||||
Reference in New Issue
Block a user