🐛 Fixes iframe widget refresh (#1571)

This commit is contained in:
Alicia Sykes
2024-05-11 15:26:32 +01:00
parent eea193ae5c
commit 07dbcccc83
2 changed files with 13 additions and 4 deletions

View File

@@ -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();
},
},