Implement pending/delivered status for messages
This commit is contained in:
11
src/main.ts
11
src/main.ts
@ -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 {
|
||||
|
Reference in New Issue
Block a user