fix(App): set initial state of presentPreferencePanel to false

This commit is contained in:
Astrian Zheng 2025-05-28 13:12:12 +10:00
parent 885a7dabab
commit 4c85a037fa
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA
2 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,5 @@
chrome.webRequest.onBeforeRequest.addListener(
(details) => {
async (details) => {
console.log(
'onBeforeRequest MAIN_FRAME:',
details.url,
@ -12,9 +12,14 @@ chrome.webRequest.onBeforeRequest.addListener(
details.type === 'other' &&
details.frameId === 0
) {
const pref = await chrome.storage.sync.get('preferences')
console.log(pref.preferences.autoRedirect)
if (pref === undefined || pref.preferences === undefined || pref.preferences.autoRedirect === undefined || pref.preferences.autoRedirect === true) {
chrome.tabs.create({ url: chrome.runtime.getURL('index.html') })
chrome.tabs.remove(details.tabId)
}
}
},
{ urls: ['https://monster-siren.hypergryph.com/manifest.json'] },
)

View File

@ -9,7 +9,7 @@ import LeftArrowIcon from './assets/icons/leftarrow.vue'
import CorgIcon from './assets/icons/corg.vue'
import { watch } from 'vue'
const presentPreferencePanel = ref(true)
const presentPreferencePanel = ref(false)
const route = useRoute()
const router = useRouter()