Skip to content

Commit

Permalink
Fix unsuported replaceAll (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
skarab42 committed Jan 24, 2021
1 parent 24fb19c commit 6467d93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/server/libs/socket.io/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { getServerURL } = require("../../utils");
const socket = require("socket.io");

let io = null;
Expand Down
5 changes: 3 additions & 2 deletions front-src/overlay/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ function runAnime(action, cb) {

if (element.innerText !== "") {
Object.entries(action.eventProps).forEach(([key, val]) => {
element.innerText = element.innerText.replaceAll(`$${key}`, val);
const regexp = new RegExp(`$${key}`, "g");
element.innerText = element.innerText.replace(regexp, val);
});
}

Expand All @@ -87,7 +88,7 @@ function runAnime(action, cb) {
timeline.play();
})
.catch((error) => {
cb({ error, action });
cb({ error: error.stack, action });
$anime.remove();
});
}
Expand Down

0 comments on commit 6467d93

Please sign in to comment.