From ae1f08e50697017c44451f009ce1cd4dfdd3ff55 Mon Sep 17 00:00:00 2001 From: or-else Date: Fri, 30 Mar 2018 20:28:34 -0700 Subject: [PATCH] don't send permissions update if permissions have not changed --- index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2b606b49..289ef043 100644 --- a/index.html +++ b/index.html @@ -751,8 +751,10 @@ }, handleSubmit: function() { - var mode = this.state.mode || "N"; - if (mode !== this.props.mode) { + // Normalize string, otherwise cannot check if mode has changed. + var mode = (this.state.mode || "N").split('').sort().join(''); + var before = (this.props.mode || "N").split('').sort().join('') + if (mode !== before) { this.props.onSubmit(mode); } else { this.props.onCancel(); @@ -1813,6 +1815,9 @@ } // Redraw without the deleted topic. this.resetContactList(); + } else if (what === "acs") { + // Permissions changed. + console.log("app: permissions changed"); } else { // TODO(gene): handle other types of notifications: // * ua -- user agent changes (may display a pictogram for mobile/desktop)