diff --git a/main.js b/main.js index aac5d8d..ec40311 100644 --- a/main.js +++ b/main.js @@ -334,7 +334,8 @@ var commands = [ }, { hint: "Send by SMS", - action: sms + action: sms, + remoteonly: true }]; var snippets = [ @@ -378,14 +379,9 @@ var snippets = [ cursor: -4 }]; + function sms() { - if (!isremote()) - { - showtemporaryinfo("SMS is not available in local mode."); - return; - } - queryremote({action: "sms", data: currentnote.content.replace(/\n/g, " ")}) .then(data => { @@ -2080,6 +2076,10 @@ function executecommand(command) { showtemporaryinfo("Cannot perform '" + command.hint + "' because current note is not saved."); } + else if (command.remoteonly && !isremote()) + { + showtemporaryinfo(command.hint + " is not available in local mode."); + } else if (command.action) { command.action();