From d54005b62ec5ba5d41d49d2490d454031cf6fb92 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 10 Mar 2017 00:17:44 +0000 Subject: [PATCH] no more duplicate snapshot buttons after taking reloading scripts --- scripts/system/snapshot.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 8f918c9cb2..55152ef245 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -211,8 +211,10 @@ Window.snapshotShared.connect(snapshotShared); Window.processingGif.connect(processingGif); Script.scriptEnding.connect(function () { - button.clicked.disconnect(onClicked); - buttonConnected = false; + if (buttonConnected) { + button.clicked.disconnect(onClicked); + buttonConnected = false; + } if (tablet) { tablet.removeButton(button); }