Skip to content

Commit

Permalink
fix: simplify message payload to be compatible with firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVandivier committed Aug 23, 2021
1 parent 194262e commit 5e5a633
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pwa/src/offline-interface/offline-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ export class OfflineInterface {
cleanUpListeners()
onCompleted()
})
this.offlineEvents.once(swMsgs.recordingError, ({ error }) => {
this.offlineEvents.once(swMsgs.recordingError, ({ msg }) => {
cleanUpListeners()
// Make error out of message from SW (firefox SW message interface
// doesn't handle payloads other than simple objects)
const error = new Error(msg)
onError(error)
})
}
Expand Down
2 changes: 1 addition & 1 deletion pwa/src/service-worker/recording-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function stopRecording(error, clientId) {
client.postMessage({
type: swMsgs.recordingError,
payload: {
error,
msg: error.message,
},
})
})
Expand Down

0 comments on commit 5e5a633

Please sign in to comment.