From d2b9c98c8d594cd88c24166a890e568ee8bcb17d Mon Sep 17 00:00:00 2001 From: MillenniumEarl Date: Thu, 8 Oct 2020 21:19:54 +0200 Subject: [PATCH] Now logout also close the shared browser --- app/index.js | 8 +++++++- app/scripts/classes/user-data.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/index.js b/app/index.js index 14b598c..a32f976 100644 --- a/app/index.js +++ b/app/index.js @@ -296,7 +296,7 @@ module.exports.getUserData = async function () { }; /** * @public - * Logout from the current user. + * Logout from the current user and gracefully close shared browser. * You **must** be logged in to the portal before calling this method. */ module.exports.logout = function () { @@ -305,6 +305,12 @@ module.exports.logout = function () { return; } shared.isLogged = false; + + // Gracefully close shared browser + if (!shared.isolation) { + _browser.close() + .then(() => _browser = null); + } }; //#endregion diff --git a/app/scripts/classes/user-data.js b/app/scripts/classes/user-data.js index 6acb128..f60014e 100644 --- a/app/scripts/classes/user-data.js +++ b/app/scripts/classes/user-data.js @@ -11,7 +11,7 @@ class UserData { */ this.username = ""; /** - * Path to the user 's profile picture. + * Path to the user's profile picture. * @type URL */ this.avatarSrc = null;