diff --git a/Logic/Actors/PendingChangesUploader.ts b/Logic/Actors/PendingChangesUploader.ts index 8fe4612..2fd0387 100644 --- a/Logic/Actors/PendingChangesUploader.ts +++ b/Logic/Actors/PendingChangesUploader.ts @@ -36,6 +36,22 @@ export default class PendingChangesUploader{ changes.flushChanges("Flushing changes due to focus lost"); } }); + + document.onfocus = () => { + changes.flushChanges("OnFocus") + } + + document.onblur = () => { + changes.flushChanges("OnFocus") + } + try{ + document.addEventListener("visibilitychange", () => { + changes.flushChanges("Visibility change") + }, false); + }catch(e){ + console.warn("Could not register visibility change listener", e) + } + window.onbeforeunload = function(e){ diff --git a/Models/Constants.ts b/Models/Constants.ts index 082ff30..78f845b 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import { Utils } from "../Utils"; export default class Constants { - public static vNumber = "0.5.2b"; + public static vNumber = "0.5.2c"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = {