mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
fix: initial install not loading seqta
This commit is contained in:
+11
-10
@@ -2,8 +2,12 @@ import {
|
|||||||
settingsState,
|
settingsState,
|
||||||
} from "@/seqta/utils/listeners/SettingsState"
|
} from "@/seqta/utils/listeners/SettingsState"
|
||||||
import documentLoadCSS from "@/css/documentload.scss?inline"
|
import documentLoadCSS from "@/css/documentload.scss?inline"
|
||||||
|
|
||||||
import icon48 from "@/resources/icons/icon-48.png?base64"
|
import icon48 from "@/resources/icons/icon-48.png?base64"
|
||||||
|
import browser from "webextension-polyfill"
|
||||||
|
|
||||||
|
import * as plugins from "@/plugins"
|
||||||
|
import { main } from "@/seqta/main"
|
||||||
|
|
||||||
|
|
||||||
export let MenuOptionsOpen = false
|
export let MenuOptionsOpen = false
|
||||||
|
|
||||||
@@ -19,9 +23,6 @@ if (document.childNodes[1]) {
|
|||||||
init()
|
init()
|
||||||
}
|
}
|
||||||
|
|
||||||
import * as plugins from "@/plugins"
|
|
||||||
import { main } from "@/seqta/main"
|
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const hasSEQTATitle = document.title.includes("SEQTA Learn")
|
const hasSEQTATitle = document.title.includes("SEQTA Learn")
|
||||||
|
|
||||||
@@ -37,16 +38,16 @@ async function init() {
|
|||||||
icon.href = icon48 // Change the icon
|
icon.href = icon48 // Change the icon
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (typeof settingsState.onoff === "undefined") {
|
||||||
|
browser.runtime.sendMessage({ type: "setDefaultStorage" })
|
||||||
|
}
|
||||||
|
|
||||||
await main()
|
await main()
|
||||||
|
|
||||||
if (settingsState.onoff) {
|
if (settingsState.onoff) {
|
||||||
// Initialize legacy plugins
|
// Initialize legacy plugins
|
||||||
const legacyPlugins = [plugins.Monofile];
|
console.log('init legacy plugins')
|
||||||
legacyPlugins.forEach(plugin => {
|
plugins.Monofile()
|
||||||
if (typeof plugin === 'function') {
|
|
||||||
plugin();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Initialize new plugin system
|
// Initialize new plugin system
|
||||||
await plugins.initializePlugins();
|
await plugins.initializePlugins();
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ const rssFeedsByCountry: Record<string, string[]> = {
|
|||||||
export async function fetchNews(source: string, sendResponse: any) {
|
export async function fetchNews(source: string, sendResponse: any) {
|
||||||
const parser = new Parser();
|
const parser = new Parser();
|
||||||
let feeds: string[];
|
let feeds: string[];
|
||||||
|
console.log('fetchNews', source)
|
||||||
|
|
||||||
if (source === "australia") {
|
if (source === "australia") {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ pluginManager.registerPlugin(notificationCollectorPlugin);
|
|||||||
pluginManager.registerPlugin(themesPlugin);
|
pluginManager.registerPlugin(themesPlugin);
|
||||||
//pluginManager.registerPlugin(testPlugin);
|
//pluginManager.registerPlugin(testPlugin);
|
||||||
|
|
||||||
// Legacy plugin exports
|
|
||||||
export { init as Monofile } from './monofile';
|
export { init as Monofile } from './monofile';
|
||||||
|
|
||||||
export async function initializePlugins(): Promise<void> {
|
export async function initializePlugins(): Promise<void> {
|
||||||
|
|||||||
@@ -585,10 +585,6 @@ export function showConflictPopup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function init() {
|
export function init() {
|
||||||
if (typeof settingsState.onoff === "undefined") {
|
|
||||||
browser.runtime.sendMessage({ type: "setDefaultStorage" })
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleDisabled = () => {
|
const handleDisabled = () => {
|
||||||
waitForElm(".code", true, 50).then(AppendElementsToDisabledPage)
|
waitForElm(".code", true, 50).then(AppendElementsToDisabledPage)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user