From 7c6da5a157e056288bb3f1da883c30d253656970 Mon Sep 17 00:00:00 2001 From: lilia Date: Sun, 7 May 2017 14:39:43 -0700 Subject: [PATCH] Make 'Restart Signal' actually restart Signal Previously it would just reload the page. // FREEBIE --- js/views/inbox_view.js | 2 +- main.js | 4 ++++ preload.js | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js index 029709434..2c74a32c6 100644 --- a/js/views/inbox_view.js +++ b/js/views/inbox_view.js @@ -177,7 +177,7 @@ 'click .showSettings': 'showSettings', 'select .gutter .conversation-list-item': 'openConversation', 'input input.search': 'filterContacts', - 'click .restart-signal': 'reloadBackgroundPage', + 'click .restart-signal': window.restart, 'show .lightbox': 'showLightbox', 'click .migrate': 'confirmMigration' }, diff --git a/main.js b/main.js index cf501e735..55b64c304 100644 --- a/main.js +++ b/main.js @@ -212,3 +212,7 @@ ipc.on('draw-attention', function(event, count) { }, 1000); } }); +ipc.on('restart', function(event) { + app.relaunch(); + app.quit(); +}); diff --git a/preload.js b/preload.js index b306230da..063374ce7 100644 --- a/preload.js +++ b/preload.js @@ -19,6 +19,10 @@ console.log('show window'); ipc.send('show-window'); }; + window.restart = function() { + console.log('restart'); + ipc.send('restart'); + }; /** * Enables spell-checking and the right-click context menu in text editors. * Electron (`webFrame.setSpellCheckProvider`) only underlines misspelled words;