Skip to content

Commit 59a88be

Browse files
committed
fix state restoration
1 parent 58ef486 commit 59a88be

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

extension.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ class BingWallpaperIndicator extends PanelMenu.Button {
585585
try {
586586
log('restoring state...');
587587
// patch for relative paths, ensures that users don't end up with broken state - see EGO review for version 38 https://extensions.gnome.org/review/30299
588-
this._settings.set_string('download-folder')(this._settings.get_string('download-folder').replace('$HOME', '~'));
588+
this._settings.set_string('download-folder', this._settings.get_string('download-folder').replace('$HOME', '~'));
589589
let stateJSON = this._settings.get_string('state');
590590
let state = JSON.parse(stateJSON);
591591
let maxLongDate = null;
@@ -614,7 +614,7 @@ class BingWallpaperIndicator extends PanelMenu.Button {
614614
return;
615615
}
616616
catch (error) {
617-
log('bad state - refreshing...');
617+
log('bad state - refreshing... error was ' + error);
618618
}
619619
this._restartTimeout(60);
620620
}

utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ function imageHasBasename(image_item, i, b) {
199199
}
200200

201201
function dateFromLongDate(longdate, add_seconds) {
202+
if (typeof longdate === 'number')
203+
longdate = longdate.toString();
202204
return GLib.DateTime.new(GLib.TimeZone.new_utc(),
203205
parseInt(longdate.substr(0, 4)), // year
204206
parseInt(longdate.substr(4, 2)), // month
@@ -209,6 +211,8 @@ function dateFromLongDate(longdate, add_seconds) {
209211
}
210212

211213
function dateFromShortDate(shortdate) {
214+
if (typeof shortdate === 'number')
215+
shortdate = shortdate.toString();
212216
return GLib.DateTime.new(GLib.TimeZone.new_utc(),
213217
parseInt(shortdate.substr(0, 4)), // year
214218
parseInt(shortdate.substr(4, 2)), // month

0 commit comments

Comments
 (0)