Implement pending/delivered status for messages

This commit is contained in:
2022-08-27 22:34:10 +02:00
parent b480d35cb1
commit 6f76004dc0
4 changed files with 45 additions and 17 deletions

View File

@ -9,8 +9,8 @@ window.addEventListener("DOMContentLoaded", () => {
}
const locutus = new Locutus.App();
if (isMobilePlatform()) {
console.log("MOBILE");
document.addEventListener("visibilitychange", () => {
if (document.visibilityState === 'hidden') {
locutus.sleep();
@ -18,12 +18,11 @@ window.addEventListener("DOMContentLoaded", () => {
locutus.wakeup().then();
}
});
} else {
console.log("DESKTOP");
window.addEventListener("beforeunload", (evt) => {
locutus.close();
});
}
window.addEventListener("beforeunload", () => {
locutus.close();
});
});
function isMobilePlatform(): boolean {