Skip to content

Commit

Permalink
fix namespacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Himyu committed Apr 17, 2022
1 parent c909093 commit 7d81318
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/gfx-script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
let previousState = 'HIDDEN'
const namespace = 'module-league-runes'

const updateUi = data => {
console.log(data);
Expand Down Expand Up @@ -77,7 +78,7 @@ const updateUi = data => {
const tick = async () => {
const data = await this.LPTE.request({
meta: {
namespace: 'rcv-rune-gfx',
namespace,
type: 'request',
version: 1
}
Expand All @@ -90,7 +91,7 @@ window.LPTE.onready(() => {
setTimeout(tick, 100)
// setInterval(tick, 1000)

window.LPTE.on('rcv-rune-gfx', 'update', data => {
window.LPTE.on(namespace, 'update', data => {
const timeout = previousState === 'HIDDEN' ? 1 : 1000
updateUi(data.state)
setTimeout(() => updateUi(data.state), timeout)
Expand Down

0 comments on commit 7d81318

Please sign in to comment.