Skip to content

Commit 775f1bf

Browse files
committed
[refactor] improve initial background colour check
1 parent 72596df commit 775f1bf

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

‎package-lock.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nightTab",
3-
"version": "5.74.0",
3+
"version": "5.75.0",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
55
"main": "index.js",
66
"scripts":{

‎src/js/data.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ var data = (function(){
266266

267267
varinit=function(){
268268
mod.nameFix();
269-
mod.restore(data.load());
269+
mod.restore(load());
270270
render.feedback.empty();
271271
};
272272

‎src/js/initial-background.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// inital check for systems which do not have light or dark mode
2-
vardata=JSON.parse(localStorage.getItem("nightTab"));
2+
varnightTabData=JSON.parse(localStorage.getItem("nightTab"));
33
if(window.matchMedia("(prefers-color-scheme:light)").matches){
4-
if(data){
5-
if(data.state.theme.style=="dark"){
4+
if(nightTabData){
5+
if(nightTabData.state.theme.style=="dark"){
66
document.querySelector("html").setAttribute("style","background-color:rgb(0,0,0)");
77
};
88
};
99
}elseif(window.matchMedia("(prefers-color-scheme:dark)").matches){
10-
if(data){
11-
if(data.state.theme.style=="light"){
10+
if(nightTabData){
11+
if(nightTabData.state.theme.style=="light"){
1212
document.querySelector("html").setAttribute("style","background-color:rgb(255,255,255)");
1313
};
1414
};

‎src/js/version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
varversion=(function(){
22

3-
varcurrent="5.74.0";
3+
varcurrent="5.75.0";
44

55
varname="Jaded Raven";
66

‎src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nightTab",
33
"short_name": "nightTab",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
5-
"version": "5.74.0",
5+
"version": "5.75.0",
66
"manifest_version": 2,
77
"chrome_url_overrides":{
88
"newtab": "index.html"

0 commit comments

Comments
(0)