Skip to content

Commit 936b689

Browse files
committed
bugfix: duplicate matchmaking modals causing elo to display unknown
1 parent dec926c commit 936b689

File tree

2 files changed

+27
-36
lines changed

2 files changed

+27
-36
lines changed

index.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@
189189
inline
190190
class="hidden w-full h-full page-content"
191191
></territory-patterns-modal>
192-
<matchmaking-modal
193-
id="page-matchmaking"
194-
inline
195-
class="hidden w-full h-full page-content"
196-
></matchmaking-modal>
197192
<user-setting
198193
id="page-settings"
199194
inline

src/client/Matchmaking.ts

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -263,39 +263,35 @@ export class MatchmakingButton extends LitElement {
263263
}
264264

265265
render() {
266-
if (this.isLoggedIn) {
267-
return html`
268-
<button
269-
@click="${this.handleLoggedInClick}"
270-
class="no-crazygames w-full h-20 bg-purple-600 hover:bg-purple-500 text-white font-black uppercase tracking-widest rounded-xl transition-all duration-200 flex flex-col items-center justify-center group overflow-hidden relative"
271-
title="${translateText("matchmaking_modal.title")}"
272-
>
273-
<span class="relative z-10 text-2xl">
274-
${translateText("matchmaking_button.play_ranked")}
275-
</span>
276-
<span
277-
class="relative z-10 text-xs font-medium text-purple-100 opacity-90 group-hover:opacity-100 transition-opacity"
266+
const button = this.isLoggedIn
267+
? html`
268+
<button
269+
@click="${this.handleLoggedInClick}"
270+
class="no-crazygames w-full h-20 bg-purple-600 hover:bg-purple-500 text-white font-black uppercase tracking-widest rounded-xl transition-all duration-200 flex flex-col items-center justify-center group overflow-hidden relative"
271+
title="${translateText("matchmaking_modal.title")}"
278272
>
279-
${translateText("matchmaking_button.description")}
280-
</span>
281-
</button>
282-
283-
<matchmaking-modal></matchmaking-modal>
284-
`;
285-
}
286-
287-
return html`
288-
<button
289-
@click="${this.handleLoggedOutClick}"
290-
class="no-crazygames w-full h-20 bg-purple-600 hover:bg-purple-500 text-white font-black uppercase tracking-widest rounded-xl transition-all duration-200 flex flex-col items-center justify-center overflow-hidden relative cursor-pointer"
291-
>
292-
<span class="relative z-10 text-2xl">
293-
${translateText("matchmaking_button.login_required")}
294-
</span>
295-
</button>
273+
<span class="relative z-10 text-2xl">
274+
${translateText("matchmaking_button.play_ranked")}
275+
</span>
276+
<span
277+
class="relative z-10 text-xs font-medium text-purple-100 opacity-90 group-hover:opacity-100 transition-opacity"
278+
>
279+
${translateText("matchmaking_button.description")}
280+
</span>
281+
</button>
282+
`
283+
: html`
284+
<button
285+
@click="${this.handleLoggedOutClick}"
286+
class="no-crazygames w-full h-20 bg-purple-600 hover:bg-purple-500 text-white font-black uppercase tracking-widest rounded-xl transition-all duration-200 flex flex-col items-center justify-center overflow-hidden relative cursor-pointer"
287+
>
288+
<span class="relative z-10 text-2xl">
289+
${translateText("matchmaking_button.login_required")}
290+
</span>
291+
</button>
292+
`;
296293

297-
<matchmaking-modal></matchmaking-modal>
298-
`;
294+
return html` ${button} <matchmaking-modal></matchmaking-modal> `;
299295
}
300296

301297
private handleLoggedInClick() {

0 commit comments

Comments
 (0)