Skip to content

Commit

Permalink
fix(dorion-notifications): tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Aug 14, 2024
1 parent 77abab8 commit 73e397f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions plugins/dorion-notifications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ const {
const [settings, setSettings] = createSignal<DorionSettings>(null)
const notifSelector = 'div[class*="contentColumn"] div[class*="container"]'

if (settings().desktop_notifications) {
Notification.requestPermission()
}

let isOnNotifSection = false
let newSettingInjected = false

Expand Down Expand Up @@ -106,9 +102,12 @@ const settingsHandler = async (payload) => {
FluxDispatcher.subscribe('USER_SETTINGS_MODAL_SET_SECTION', settingsHandler)

export const onLoad = async () => {
setSettings(
JSON.parse(await invoke('read_config_file'))
)
const cfg = JSON.parse(await invoke('read_config_file'))
setSettings(cfg)

if (cfg.desktop_notifications) {
Notification.requestPermission()
}
}

export const onUnload = () => {
Expand Down

0 comments on commit 73e397f

Please sign in to comment.