Added empty session alerts where needed.

This commit is contained in:
Maxim Stewart 2019-04-19 16:21:29 -05:00
parent 08c2f9f1d5
commit 9b940f1d7a
3 changed files with 15 additions and 6 deletions

View File

@ -4,9 +4,8 @@ Easy Session Manager allows you to manage your Firefox session by backing up or
# Download # Download
https://addons.mozilla.org/en-US/firefox/addon/easy-session-manager/ https://addons.mozilla.org/en-US/firefox/addon/easy-session-manager/
# Version: 0.2.1.0 # Version: 0.2.1.1
Fixed edit logic when renaming session overwrites another session with the same name. Added alert when session is empty and trying to load it....
Split helper logic to utils.js.
# Images # Images
![1 Default interface with no sessions. ](images/pic1.png) ![1 Default interface with no sessions. ](images/pic1.png)

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": " Easy Session Manager", "name": " Easy Session Manager",
"version": "0.2.1.0", "version": "0.2.1.1",
"description": " Easy Session Manager allows you to manage your Firefox session by backing up or loading your saved sessions.", "description": " Easy Session Manager allows you to manage your Firefox session by backing up or loading your saved sessions.",
"applications": { "applications": {

View File

@ -194,6 +194,13 @@ const loadSession = (json = null, replaceTabs = false) => {
let wasCurrentTabId = null; let wasCurrentTabId = null;
if (replaceTabs) { // Clear all windows but main then load... if (replaceTabs) { // Clear all windows but main then load...
if (keysLength == 0) {
swal("Canceled operation; no tabs in session...", {
icon: "error",
});
return ;
}
for (let i = 0; i < windows.length; i++) { for (let i = 0; i < windows.length; i++) {
if (currentWindow.id != windows[i].id) { if (currentWindow.id != windows[i].id) {
windowSys.remove(windows[i].id); windowSys.remove(windows[i].id);
@ -222,11 +229,14 @@ const loadSession = (json = null, replaceTabs = false) => {
windowMaker(1, keysLength, keys, json) windowMaker(1, keysLength, keys, json)
} }
} else { // Load into new windows... } else { // Load into new windows...
if (keysLength > 0) { if (keysLength == 1) {
windowMaker(0, keysLength, keys, json) windowMaker(0, keysLength, keys, json)
} else if (keysLength == 0) {
swal("Canceled operation; no tabs in session...", {
icon: "error",
});
} }
} }
}); });
}); });
} catch (e) { console.log(e); } } catch (e) { console.log(e); }