Skip to content

Commit

Permalink
use closure
Browse files Browse the repository at this point in the history
  • Loading branch information
lartsch committed Dec 25, 2022
1 parent 222b6b9 commit 8624ca5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var browser, chrome, settings
const enableConsoleLog = true
const enableConsoleLog = false
const logPrepend = "[FediAct]"
const tokenInterval = 1 // minutes
const mutesApi = "/api/v1/mutes"
Expand Down Expand Up @@ -197,10 +197,10 @@ async function reloadListeningScripts() {
}

// fetch api token right after install (mostly for debugging, when the ext. is reloaded)
chrome.runtime.onInstalled.addListener(fetchData(true, true))
chrome.runtime.onInstalled.addListener(function(){fetchData(true, true)})
// and also every 3 minutes
chrome.alarms.create('refresh', { periodInMinutes: tokenInterval })
chrome.alarms.onAlarm.addListener(fetchData(true, true))
chrome.alarms.onAlarm.addListener(function(){fetchData(true, true)})

// different listeners for inter-script communication
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
Expand Down
2 changes: 1 addition & 1 deletion src/background.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8624ca5

Please sign in to comment.