Skip to content

Commit b497b3b

Browse files
committed
make sure we handle the case where there is no push message body
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent a98823f commit b497b3b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/assistant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export async function openAssistantForm({
137137
const hasPush = listen(pushChannel, (type, body) => {
138138
console.debug('[assistant] received push notification', type, body)
139139
if (pushTaskId === view.selectedTaskId) {
140-
view.outputs = body
140+
view.outputs = body ?? null
141141
} else {
142142
console.debug('[assistant] ignoring push notification for task', pushTaskId, 'the selected one is', view.selectedTaskId)
143143
}
@@ -644,7 +644,7 @@ export async function openAssistantTask(
644644
const hasPush = listen(pushChannel, (type, body) => {
645645
console.debug('[assistant] received push notification', type, body)
646646
if (pushTaskId === view.selectedTaskId) {
647-
view.outputs = body
647+
view.outputs = body ?? null
648648
} else {
649649
console.debug('[assistant] ignoring push notification for task', pushTaskId, 'the selected one is', view.selectedTaskId)
650650
}

src/views/AssistantPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default {
122122
const hasPush = listen(pushChannel, (type, body) => {
123123
console.debug('[assistant] received push notification', type, body)
124124
if (pushTaskId === this.task.id) {
125-
this.task.output = body
125+
this.task.output = body ?? null
126126
} else {
127127
console.debug('[assistant] ignoring push notification for task', pushTaskId, 'the selected one is', this.task.id)
128128
}

0 commit comments

Comments
 (0)