mirror of
https://github.com/Lissy93/dashy.git
synced 2024-12-23 00:41:37 +03:00
🐛 Fixes iframe widget refresh (#1571)
This commit is contained in:
parent
eea193ae5c
commit
07dbcccc83
@ -45,8 +45,17 @@ export default {
|
||||
/* Refreshes iframe contents, called by parent */
|
||||
update() {
|
||||
this.startLoading();
|
||||
this.updateCount += 1;
|
||||
(document.getElementById(this.frameId) || {}).src = this.frameUrl;
|
||||
const iframe = document.getElementById(this.frameId);
|
||||
if (iframe.contentWindow) {
|
||||
try {
|
||||
iframe.contentWindow.location.href = this.frameUrl;
|
||||
iframe.contentWindow.location.reload(true);
|
||||
} catch (e) {
|
||||
this.error('Failed to refresh iframe', e, true);
|
||||
}
|
||||
} else {
|
||||
this.error('Couldn\'t find iframe', null, true);
|
||||
}
|
||||
this.finishLoading();
|
||||
},
|
||||
},
|
||||
|
@ -72,9 +72,9 @@ const WidgetMixin = {
|
||||
this.updater = setInterval(() => { this.update(); }, this.updateInterval);
|
||||
},
|
||||
/* Called when an error occurs. Logs to handler, and passes to parent component */
|
||||
error(msg, stackTrace) {
|
||||
error(msg, stackTrace, quite = false) {
|
||||
ErrorHandler(msg, stackTrace);
|
||||
if (!this.options.ignoreErrors) {
|
||||
if (!this.options.ignoreErrors && !quite) {
|
||||
this.$emit('error', msg);
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user