Skip to content

Commit a3a78f3

Browse files
author
thyttan
committed
messagegui: refactor global. -> globalThis.
1 parent dadcf1c commit a3a78f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/messagegui/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if (Graphics.prototype.setFontIntl) {
4848
var active; // active screen (undefined/"list"/"music"/"map"/"overview"/"scroller"/"settings")
4949
var openMusic = false; // go back to music screen after we handle something else?
5050
var replying = false; // If we're replying to a message, don't interrupt
51-
var persist = "messagegui.new.js"!==global.__FILE__;
51+
var persist = "messagegui.new.js"!==globalThis.__FILE__;
5252

5353
// hack for 2v10 firmware's lack of ':size' font handling
5454
try {
@@ -361,7 +361,7 @@ function showMessagesScroller(msg, persist) {
361361
Bangle.emit("drag", {dy:0}); // Compatibility with `kineticscroll`, stopping the scroller so it doesn't continue scrolling when the `showMessageOverview` screen is loaded.
362362
// Zero ms timeout as to not move on before the scroller has registered the emitted drag event.
363363
setTimeout(()=>{
364-
if ("messagegui.new.js"===global.__FILE__) {return load();}
364+
if ("messagegui.new.js"===globalThis.__FILE__) {return load();}
365365
Bangle.emit("touch", 1, {x:APP_RECT.x2/2, y:APP_RECT.y2/2, type:0});
366366
},0);
367367
}, BTN);
@@ -628,10 +628,10 @@ function checkMessages(options) {
628628
delete newMessages[0].show; // stop us getting stuck here if we're called a second time
629629
showMessagesScroller(newMessages[0], persist);
630630
// buzz after showMessagesScroller, so being busy during scroller setup doesn't affect the buzz pattern
631-
if (global.BUZZ_ON_NEW_MESSAGE) {
631+
if (globalThis.BUZZ_ON_NEW_MESSAGE) {
632632
// this is set if we entered the messages app by loading `messagegui.new.js`
633633
// ... but only buzz the first time we view a new message
634-
global.BUZZ_ON_NEW_MESSAGE = false;
634+
globalThis.BUZZ_ON_NEW_MESSAGE = false;
635635
// messages.buzz respects quiet mode - no need to check here
636636
require("messages").buzz(newMessages[0].src);
637637
}

0 commit comments

Comments
 (0)