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