Răsfoiți Sursa

Test in prod 3

Clément Wolf 6 luni în urmă
părinte
comite
d823880384
3 a modificat fișierele cu 3 adăugiri și 6 ștergeri
  1. 1 3
      elo.js
  2. 1 2
      public/extra.js
  3. 1 1
      views/jspage.eta

+ 1 - 3
elo.js

@@ -169,13 +169,11 @@ async function save_game_and_update_rating(lobby, game) {
     'Legendary',
     'The One',
   ];
-  for (const score of game.scores) {
-    await update_the_one(score.user_id, score.rating.elo, game.mode_int);
-  }
 
   const rank_changes = [];
   for (const score of game.scores) {
     const player = await get_user_by_id(score.user_id);
+    await update_the_one(score.user_id, score.rating.elo, game.mode_int);
     if (player.ratings[game.mode_int].s3_scores < Config.games_needed_for_rank) continue;
 
     const old_rank_text = player.ratings[game.mode_int].division;

+ 1 - 2
public/extra.js

@@ -215,12 +215,11 @@ async function render_lobbies() {
   const template = document.querySelector('#lobbies-template').content.cloneNode(true);
 
   const res = await fetch(`/api/lobbies/`, {
-    credentials: 'include',
+    method: 'GET',
     headers: {
       'Accept': 'application/json',
       'Content-Type': 'application/json',
     },
-    method: 'POST',
   });
   const json = await res.json();
 

+ 1 - 1
views/jspage.eta

@@ -10,7 +10,7 @@
     <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
     <script defer src="/twemoji.min.js"></script>
     <script defer src="/base.js?v=2" type="module"></script>
-    <script defer src="/extra.js?v=1" type="module"></script>
+    <script defer src="/extra.js?v=2" type="module"></script>
   </head>
   <body class="bg-zinc-800">
     <header class="h-16 bg-zinc-900">