Skip to content

Commit

Permalink
Fixed serversideup#42 - by reconnecting onpagesshow event
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjadahl committed Oct 21, 2022
1 parent 81c4b7f commit d695031
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/internal/persistent-port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export const createPersistentPort = (name = '') => {
})
}

window.onpageshow = (event) => {
if (event.persisted) connect()
}

connect()

return {
Expand Down

0 comments on commit d695031

Please sign in to comment.