diff --git a/apps/swp2clk/ChangeLog b/apps/swp2clk/ChangeLog index 083b20858..d6f9f6e8c 100644 --- a/apps/swp2clk/ChangeLog +++ b/apps/swp2clk/ChangeLog @@ -1,3 +1,4 @@ 0.01: Initial creation of "Swipe back to the Clock" App. Let's you swipe from left to right on any app to return back to the clock face. 0.02: Fix deleting from white and black lists. 0.03: Adapt to availability of Bangle.showClock and Bangle.load +0.04: Fix 'Uncaught ReferenceError: "__FILE__" is not defined' error (fix #2326) diff --git a/apps/swp2clk/boot.js b/apps/swp2clk/boot.js index 389c3dddf..f2c642adf 100644 --- a/apps/swp2clk/boot.js +++ b/apps/swp2clk/boot.js @@ -29,12 +29,13 @@ })(Bangle.load); let swipeHandler = (dir) => { - log("swipe:" + dir + " on app: " + __FILE__); + let currentFile = global.__FILE__||"default"; + log("swipe:" + dir + " on app: " + currentFile); - if (!inhibit && dir === 1 && !Bangle.CLOCK && __FILE__ != ".bootcde") { - log("on a not clock app " + __FILE__); - if ((settings.mode === 1 && settings.whiteList.includes(__FILE__)) || // "White List" - (settings.mode === 2 && !settings.blackList.includes(__FILE__)) || // "Black List" + if (!inhibit && dir === 1 && !Bangle.CLOCK) { + log("on a not clock app " + currentFile); + if ((settings.mode === 1 && settings.whiteList.includes(currentFile)) || // "White List" + (settings.mode === 2 && !settings.blackList.includes(currentFile)) || // "Black List" settings.mode === 3) { // "Always" log("load clock"); Bangle.showClock(); diff --git a/apps/swp2clk/metadata.json b/apps/swp2clk/metadata.json index 7552de26c..b4436bd39 100644 --- a/apps/swp2clk/metadata.json +++ b/apps/swp2clk/metadata.json @@ -2,7 +2,7 @@ "id": "swp2clk", "name": "Swipe back to the Clock", "shortName": "Swipe to Clock", - "version": "0.03", + "version": "0.04", "description": "Let's you swipe from left to right on any app to return back to the clock face. Please configure in the settings app after installing to activate, since its disabled by default.", "icon": "app.png", "type": "bootloader",