From ca50a4dbd989f8289539ac032ea0f5afb7eeb526 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 21 Sep 2020 15:24:18 +0100 Subject: [PATCH] 0.05: Fix `g` corruption issue if .hide gets called twice --- apps.json | 2 +- apps/notifyfs/ChangeLog | 3 ++- apps/notifyfs/notify.js | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps.json b/apps.json index 07aa644f6..726b9d14b 100644 --- a/apps.json +++ b/apps.json @@ -93,7 +93,7 @@ "name": "Fullscreen Notifications", "shortName":"Notifications", "icon": "notify.png", - "version":"0.04", + "version":"0.05", "description": "A handler for displaying notifications that displays them fullscreen. This may not fully restore the screen after on some apps. See `Notifications (default)` for more information about the notifications library.", "tags": "widget", "type": "notify", diff --git a/apps/notifyfs/ChangeLog b/apps/notifyfs/ChangeLog index bf5c73161..b359d314b 100644 --- a/apps/notifyfs/ChangeLog +++ b/apps/notifyfs/ChangeLog @@ -1,4 +1,5 @@ 0.01: New Library! 0.02: Add notification ID option 0.03: Fix custom render callback -0.04: Pass `area{x,y,w,h}` to render callback instead of just `y` \ No newline at end of file +0.04: Pass `area{x,y,w,h}` to render callback instead of just `y` +0.05: Fix `g` corruption issue if .hide gets called twice diff --git a/apps/notifyfs/notify.js b/apps/notifyfs/notify.js index 7d317fa43..74a8d4912 100644 --- a/apps/notifyfs/notify.js +++ b/apps/notifyfs/notify.js @@ -106,8 +106,10 @@ exports.hide = function(options) { options = options||{}; if ("id" in options && options.id!==id) return; id = null; - g=oldg; - oldg = undefined; + if (oldg) { + g=oldg; + oldg = undefined; + } Bangle.removeListener("touch", exports.hide); g.clear(); Bangle.drawWidgets();