Skip to content

Commit

Permalink
fix: Close emotesChannel to avoid unexpected behavior in the browser (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox authored Nov 8, 2022
1 parent f51d80b commit d994b6a
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/modules/editor/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,23 +501,27 @@ function* handleSetWearablePreviewController() {
if (controller) {
const emotesChannel = createWearablePreviewChannel(controller)

while (true) {
try {
const event: string = yield take(emotesChannel)
switch (event) {
case PreviewEmoteEventType.ANIMATION_PLAY:
yield put(setEmotePlaying(true))
break
case PreviewEmoteEventType.ANIMATION_PAUSE:
yield put(setEmotePlaying(false))
break
case PreviewEmoteEventType.ANIMATION_END:
yield put(setEmotePlaying(false))
break
try {
while (true) {
try {
const event: string = yield take(emotesChannel)
switch (event) {
case PreviewEmoteEventType.ANIMATION_PLAY:
yield put(setEmotePlaying(true))
break
case PreviewEmoteEventType.ANIMATION_PAUSE:
yield put(setEmotePlaying(false))
break
case PreviewEmoteEventType.ANIMATION_END:
yield put(setEmotePlaying(false))
break
}
} catch (error) {
yield put(setEmotePlaying(false))
}
} catch (error) {
yield put(setEmotePlaying(false))
}
} finally {
emotesChannel.close()
}
}
}
Expand Down

1 comment on commit d994b6a

@vercel
Copy link

@vercel vercel bot commented on d994b6a Nov 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder – ./

builder-decentraland1.vercel.app
builder-git-master-decentraland1.vercel.app

Please sign in to comment.