Skip to content

Commit

Permalink
fix(settings): init possible issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyurec committed Oct 12, 2022
1 parent daa6e73 commit 6ad0a6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/awesomeLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
faviconsLoad, faviconsUnload,
journalIconsLoad, journalIconsUnload,
sidebarIconsLoad, sidebarIconsUnload,
initLinksObserver, stopLinksObserver, runLinksObserver, settingsLoad
initLinksObserver, stopLinksObserver, runLinksObserver,
settingsLoad
} from './modules/internal';

const registerPlugin = async () => {
Expand All @@ -21,7 +22,6 @@ const registerPlugin = async () => {

// Main logic runners
const runStuff = async () => {
settingsLoad();
initLinksObserver();
getDOMContainers();
setTimeout(() => {
Expand Down Expand Up @@ -50,8 +50,8 @@ const stopStuff = () => {
const main = async () => {
console.log(`AwesomeIcons: plugin loaded`);

globalContext.pluginConfig = logseq.settings;
registerPlugin();
settingsLoad();

runStuff();

Expand Down
2 changes: 2 additions & 0 deletions src/modules/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export const settingsConfig: SettingSchemaDesc[] = [

export const settingsLoad = () => {
logseq.useSettingsSchema(settingsConfig);
globalContext.pluginConfig = logseq.settings;

logseq.onSettingsChanged((settings, oldSettings) => {
onSettingsChangedCallback(settings, oldSettings);
});
Expand Down

0 comments on commit 6ad0a6e

Please sign in to comment.