[refactor] improve data module load function

This commit is contained in:
zombieFox 2020-04-04 15:47:22 +01:00
parent 8118e5b0a3
commit bf04c20750
5 changed files with 9 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "nightTab", "name": "nightTab",
"version": "5.4.2", "version": "5.5.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "nightTab", "name": "nightTab",
"version": "5.4.2", "version": "5.5.0",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -235,7 +235,11 @@ var data = (function() {
}; };
var load = function() { var load = function() {
return JSON.parse(mod.get(_saveName)); if (mod.get(_saveName) != null && mod.get(_saveName) != undefined) {
return JSON.parse(mod.get(_saveName));
} else {
return false;
};
}; };
var wipe = function() { var wipe = function() {

View File

@ -1,6 +1,6 @@
var version = (function() { var version = (function() {
var current = "5.4.2"; var current = "5.5.0";
var name = "Zonked Tarsier"; var name = "Zonked Tarsier";

View File

@ -2,7 +2,7 @@
"name": "nightTab", "name": "nightTab",
"short_name": "nightTab", "short_name": "nightTab",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"version": "5.4.2", "version": "5.5.0",
"manifest_version": 2, "manifest_version": 2,
"chrome_url_overrides": { "chrome_url_overrides": {
"newtab": "index.html" "newtab": "index.html"