-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #803 from NeurodataWithoutBorders/flatten-electron…
…-file Flatten Electron file
- Loading branch information
Showing
12 changed files
with
151 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
let updateAvailable = false; | ||
const updateAvailableCallbacks = []; | ||
export const onUpdateAvailable = (callback) => { | ||
if (updateAvailable) callback(updateAvailable); | ||
else updateAvailableCallbacks.push(callback); | ||
}; | ||
|
||
let updateProgress = null; | ||
|
||
const updateProgressCallbacks = []; | ||
export const onUpdateProgress = (callback) => { | ||
if (updateProgress) callback(updateProgress); | ||
else updateProgressCallbacks.push(callback); | ||
}; | ||
|
||
export const registerUpdateProgress = (info) => { | ||
updateProgress = info; | ||
updateProgressCallbacks.forEach((cb) => cb(info)); | ||
}; | ||
|
||
export const registerUpdate = (info) => { | ||
updateAvailable = info; | ||
document.body.setAttribute("data-update-available", JSON.stringify(info)); | ||
updateAvailableCallbacks.forEach((cb) => cb(info)); | ||
}; |
Oops, something went wrong.