Skip to content

Commit

Permalink
Update BroadcastChannel name in globalApi.ts (#353)
Browse files Browse the repository at this point in the history
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?

# Description
  • Loading branch information
kwaroran authored Apr 8, 2024
2 parents 2f51f26 + 20b268a commit 0633048
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ts/storage/globalApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ export async function saveDb(){
})
let gotChannel = false
const sessionID = v4()
const channel = BroadcastChannel ? (new BroadcastChannel('risu-active')): null
let channel:BroadcastChannel
if(BroadcastChannel){
channel = new BroadcastChannel('risu-db')
}
if(channel){
channel.onmessage = async (ev) => {
if(ev.data === sessionID){
Expand Down

0 comments on commit 0633048

Please sign in to comment.