Don't try to set variant if the current time is unavailable
This commit is contained in:
@@ -144,7 +144,7 @@ var GtkThemer = class {
|
|||||||
_onManualGtkVariantsChanged(_settings, enabled) {
|
_onManualGtkVariantsChanged(_settings, enabled) {
|
||||||
this.disable();
|
this.disable();
|
||||||
this.enable();
|
this.enable();
|
||||||
if (enabled && e.timer.time)
|
if (enabled)
|
||||||
this._setVariant(e.timer.time);
|
this._setVariant(e.timer.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,6 +158,8 @@ var GtkThemer = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setVariant(time) {
|
_setVariant(time) {
|
||||||
|
if (!time)
|
||||||
|
return;
|
||||||
logDebug(`Setting the GTK ${time} variant...`);
|
logDebug(`Setting the GTK ${time} variant...`);
|
||||||
switch (time) {
|
switch (time) {
|
||||||
case 'day':
|
case 'day':
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ var ShellThemer = class {
|
|||||||
_onManualShellVariantsChanged(_settings, enabled) {
|
_onManualShellVariantsChanged(_settings, enabled) {
|
||||||
this.disable();
|
this.disable();
|
||||||
this.enable();
|
this.enable();
|
||||||
if (enabled && e.timer.time)
|
if (enabled)
|
||||||
this._setVariant(e.timer.time);
|
this._setVariant(e.timer.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,6 +158,8 @@ var ShellThemer = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setVariant(time) {
|
_setVariant(time) {
|
||||||
|
if (!time)
|
||||||
|
return;
|
||||||
logDebug(`Setting the shell ${time} variant...`);
|
logDebug(`Setting the shell ${time} variant...`);
|
||||||
let shellTheme;
|
let shellTheme;
|
||||||
switch (time) {
|
switch (time) {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ var Timer = class {
|
|||||||
|
|
||||||
|
|
||||||
get time() {
|
get time() {
|
||||||
return this._source.time;
|
return this._source ? this._source.time : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user