emit/handle loggingEnded
This commit is contained in:
parent
e9795f4a00
commit
c83f8530f8
@ -203,7 +203,8 @@ export default {
|
||||
computed: {
|
||||
...mapState([
|
||||
'uwLog',
|
||||
'showLogger'
|
||||
'showLogger',
|
||||
'loggingEnded',
|
||||
]),
|
||||
},
|
||||
watch: {
|
||||
@ -220,6 +221,12 @@ export default {
|
||||
if (newValue) {
|
||||
this.getLoggerSettings();
|
||||
}
|
||||
},
|
||||
loggingEnded(newValue) {
|
||||
console.log("is loggign ended?", newValue)
|
||||
if (newValue) {
|
||||
this.stopLogging();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -22,7 +22,7 @@ class UwUi {
|
||||
this.commsHandlers = {
|
||||
'show-logger': [() => this.showLogger()],
|
||||
'hide-logger': [() => this.hideLogger()],
|
||||
'emit-logs' : [(message) => {console.log("emit logs received in uwui!", message); this.addLogs(message)}]
|
||||
'emit-logs' : [(message) => this.addLogs(message)]
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,6 +227,13 @@ class UwUi {
|
||||
|
||||
addLogs(message) {
|
||||
this.logger.appendLog(JSON.parse(message.payload));
|
||||
|
||||
// since this gets called _after_ logging has been finished,
|
||||
// we also inform logger UI to save current settings
|
||||
if (this.vueInitiated && this.vuexStore !== undefined) {
|
||||
console.log("got add logs. payload:", message.payload);
|
||||
this.vuexStore.dispatch('uw-logging-ended', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user