Skip to content

Commit

Permalink
start background processor earlier to react in some conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
lartsch committed Dec 15, 2022
1 parent 37e680b commit dbf1813
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,12 @@ async function checkSite() {
} else {
settings.fediact_exturi = uri
}
// at this point, we know that it's mastodon and the background processor should start running
if (!backgroundProcessor()) {
log("Could not start background process")
return false
}
// if option is enabled, check if logged in on that instance and stop
if (!settings.fediact_runifloggedin) {
if (await isLoggedIn()) {
log("Already logged in to this external instance.")
Expand Down Expand Up @@ -1251,12 +1257,8 @@ async function run() {
if (fedireply) {
processReply()
} else {
if (backgroundProcessor()) {
processFollow()
processToots()
} else {
log("Failed to initialize background script.")
}
processFollow()
processToots()
}
} else {
log("Will not process this site.")
Expand Down
Loading

0 comments on commit dbf1813

Please sign in to comment.