Skip to content

Commit

Permalink
html: watcher: Fix watcher path reference
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Dec 5, 2023
1 parent 3193ef8 commit 34abfa9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/html/watcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@
if (this.messageName !== undefined && jsonData.message.type !== this.messageName) {
return
}
if (path !== []) {
jsonData = path.reduce((a, b)=> a[b], jsonData)

jsonData = path.reduce((a, b)=> a[b], jsonData)
if ('header' in jsonData && 'message' in jsonData) {
this.setMessage(jsonData.message)
} else {
this.setMessage(jsonData)
}

this.time = new Date()
delete jsonData.header
this.setMessage(jsonData.message)
};

this.socket.onclose = (event) => {
Expand Down

0 comments on commit 34abfa9

Please sign in to comment.