From 1c6c6620d3a90c06b59843f4840ee59142f3a790 Mon Sep 17 00:00:00 2001 From: Jonathan Perry-Houts <75693008+jph-sendlater@users.noreply.github.com> Date: Tue, 23 Mar 2021 09:13:30 -0700 Subject: [PATCH] Keep SL enabled even if copy operation fails. --- experiments/sl3u.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/experiments/sl3u.js b/experiments/sl3u.js index e65d2cf6..9b93b6a8 100644 --- a/experiments/sl3u.js +++ b/experiments/sl3u.js @@ -1295,19 +1295,22 @@ var SL3U = class extends ExtensionCommon.ExtensionAPI { status ); - const localStorage = context.apiCan.findAPIPath("storage.local"); - localStorage.callMethodInParentProcess( - "get", [{ "preferences": {} }] - ).then(({ preferences }) => { - preferences.checkEvery = 0; - localStorage.callMethodInParentProcess( - "set", { preferences } - ); - }).catch((err) => - SendLaterFunctions.error(`Unable to disable extension`,err) - ); + //// Maybe disable Send Later if copy operation failed? + // const localStorage = context.apiCan.findAPIPath("storage.local"); + // localStorage.callMethodInParentProcess( + // "get", [{ "preferences": {} }] + // ).then(({ preferences }) => { + // preferences.checkEvery = 0; + // localStorage.callMethodInParentProcess( + // "set", { preferences } + // ); + // }).catch((err) => + // SendLaterFunctions.error(`Unable to disable extension`,err) + // ); + + const hexStatus = `0x${status.toString(16)}`; const CopyUnsentError = - SendLaterFunctions.getMessage(context, "CopyUnsentError", [status]); + SendLaterFunctions.getMessage(context, "CopyUnsentError", [hexStatus]); Services.prompt.alert(null, null, CopyUnsentError); } }, @@ -1349,7 +1352,7 @@ var SL3U = class extends ExtensionCommon.ExtensionAPI { if (Components.isSuccessCode(status)) { SendLaterFunctions.debug("SL3U.saveMessage: Saved updated message"); } else { - SendLaterFunctions.error("SL3U.saveMessage:",status); + SendLaterFunctions.error("SL3U.saveMessage:", `0x${status.toString(16)}`); } }, SetMessageKey: function(key) {