Don't try to set variant if the current time is unavailable

This commit is contained in:
Romain Vigier
2020-08-05 12:23:04 +02:00
parent 2af512482d
commit 9e18f1f038
3 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -144,7 +144,7 @@ var GtkThemer = class {
_onManualGtkVariantsChanged(_settings, enabled) {
this.disable();
this.enable();
if (enabled && e.timer.time)
if (enabled)
this._setVariant(e.timer.time);
}
@@ -158,6 +158,8 @@ var GtkThemer = class {
}
_setVariant(time) {
if (!time)
return;
logDebug(`Setting the GTK ${time} variant...`);
switch (time) {
case 'day':
+3 -1
View File
@@ -144,7 +144,7 @@ var ShellThemer = class {
_onManualShellVariantsChanged(_settings, enabled) {
this.disable();
this.enable();
if (enabled && e.timer.time)
if (enabled)
this._setVariant(e.timer.time);
}
@@ -158,6 +158,8 @@ var ShellThemer = class {
}
_setVariant(time) {
if (!time)
return;
logDebug(`Setting the shell ${time} variant...`);
let shellTheme;
switch (time) {
+1 -1
View File
@@ -75,7 +75,7 @@ var Timer = class {
get time() {
return this._source.time;
return this._source ? this._source.time : null;
}