Skip to content

Commit

Permalink
fix: always tell chat new mmr
Browse files Browse the repository at this point in the history
  • Loading branch information
Geczy committed Aug 9, 2023
1 parent 301bf92 commit fe5028a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/dota/src/db/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ class SetupSupabase {
if (newObj.mmr !== 0 && client.mmr !== newObj.mmr && oldObj.mmr !== newObj.mmr) {
client.mmr = newObj.mmr

if (!client.stream_online) return
logger.info('[WATCHER MMR] Sending mmr to socket', {
name: client.name,
mmr: newObj.mmr,
Expand All @@ -143,6 +142,8 @@ class SetupSupabase {
oldMmr: oldObj.mmr,
})

if (!client.stream_online) return

try {
void handler()
} catch (e) {
Expand Down Expand Up @@ -253,14 +254,16 @@ class SetupSupabase {
if (client.steam32Id === newObj.steam32Id) {
client.mmr = newObj.mmr

if (!client.stream_online) return
tellChatNewMMR({
locale: client.locale,
token: client.token,
streamDelay: getValueOrDefault(DBSettings.streamDelay, client.settings),
mmr: newObj.mmr,
oldMmr: oldObj.mmr,
})

if (!client.stream_online) return

getRankDetail(newObj.mmr, newObj.steam32Id)
.then((deets) => {
server.io.to(client.token).emit('update-medal', deets)
Expand Down

0 comments on commit fe5028a

Please sign in to comment.