summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/me2mom/remoting.js
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/webapp/me2mom/remoting.js')
-rw-r--r--remoting/webapp/me2mom/remoting.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js
index aedac36..484212e 100644
--- a/remoting/webapp/me2mom/remoting.js
+++ b/remoting/webapp/me2mom/remoting.js
@@ -598,21 +598,19 @@ remoting.disconnect = function() {
}
}
-/** If the client is connected, or the host is shared, prompt before closing.
+/**
+ * If the client is connected, or the host is shared, prompt before closing.
*
* @return {(string|void)} The prompt string if a connection is active.
*/
remoting.promptClose = function() {
- var messageId = null;
- if (remoting.getMajorMode() == remoting.AppMode.HOST &&
- remoting.currentMode != remoting.AppMode.HOST_UNSHARED) {
- messageId = 'closePromptHost';
- } else if (remoting.getMajorMode() == remoting.AppMode.IN_SESSION ||
- remoting.currentMode == remoting.AppMode.CLIENT_CONNECTING) {
- messageId = 'closePromptClient';
- }
- if (messageId) {
- var result = chrome.i18n.getMessage(messageId);
+ // Prompt to close if the host is in any state other than unshared, or if the
+ // client is connecting or has already connected.
+ if ((remoting.getMajorMode() == remoting.AppMode.HOST &&
+ remoting.currentMode != remoting.AppMode.HOST_UNSHARED) ||
+ remoting.getMajorMode() == remoting.AppMode.IN_SESSION ||
+ remoting.currentMode == remoting.AppMode.CLIENT_CONNECTING) {
+ var result = chrome.i18n.getMessage('closePrompt');
return result;
}
}