Skip to content

Commit dfc7e9c

Browse files
authored
Merge pull request #6701 from FlowFuse/6426_open-immersive-editor-toast
Switch to immediate watcher to retrieve logs and update schedule
2 parents 79c9fd9 + 669bca7 commit dfc7e9c

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

frontend/src/pages/instance/Overview.vue

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -234,34 +234,33 @@ export default {
234234
}
235235
},
236236
watch: {
237-
'instance.id': function (old, news) {
238-
this.loadLogs()
239-
this.getUpdateSchedule(this.instance.id)
237+
instance: {
238+
handler: function (instance) {
239+
if (instance) {
240+
this.loadLogs()
241+
this.getUpdateSchedule(instance.id)
242+
}
243+
},
244+
immediate: true
240245
}
241246
},
242-
mounted () {
243-
this.loadLogs()
244-
this.getUpdateSchedule(this.instance.id)
245-
},
246247
methods: {
247248
openUrl () {
248249
this.openInANewTab(this.instance.url, `_${this.instance.id}`)
249250
},
250251
loadLogs () {
251-
if (this.instance && this.instance.id) {
252-
this.loading = true
253-
this.loadItems(this.instance.id)
254-
.then((data) => {
255-
this.auditLog = data.log
256-
})
257-
.catch((error) => {
258-
console.error('Error loading logs:', error)
259-
this.auditLog = []
260-
})
261-
.finally(() => {
262-
this.loading = false
263-
})
264-
}
252+
this.loading = true
253+
this.loadItems(this.instance.id)
254+
.then((data) => {
255+
this.auditLog = data.log
256+
})
257+
.catch((error) => {
258+
console.error('Error loading logs:', error)
259+
this.auditLog = []
260+
})
261+
.finally(() => {
262+
this.loading = false
263+
})
265264
},
266265
loadItems: async function (instanceId, cursor) {
267266
return await InstanceApi.getInstanceAuditLog(instanceId, null, cursor, 4)

0 commit comments

Comments
 (0)