Removing the "Ask others to follow you?" popup

No need to ask twice, the user just pressed the "follow" button.
This commit is contained in:
David Négrier 2021-12-24 13:48:35 +01:00
parent 05bedf0c22
commit fefe7c8aa5

View file

@ -58,6 +58,7 @@ vim: ft=typescript
function sendFollowRequest() {
gameScene.connection?.emitFollowRequest();
followRoleStore.set(followRoles.leader);
followStateStore.set(followStates.active);
}
@ -75,11 +76,6 @@ vim: ft=typescript
followUsersStore.stopFollowing();
}
function request() {
followStateStore.set(followStates.requesting);
followRoleStore.set(followRoles.leader);
}
function onKeyDown(e: KeyboardEvent) {
if (e.key === "Escape") {
reset();
@ -106,12 +102,7 @@ vim: ft=typescript
</section>
{:else if followRole === followRoles.leader}
<section class="interact-menu-question">
<p>Ask others to follow you?</p>
</section>
<section class="interact-menu-action">
<button type="button" class="nes-btn is-success" on:click|preventDefault={sendFollowRequest}>Yes</button
>
<button type="button" class="nes-btn is-error" on:click|preventDefault={reset}>No</button>
<p>Should never be displayed</p>
</section>
{/if}
</div>
@ -160,7 +151,7 @@ vim: ft=typescript
<button
type="button"
class="nes-btn is-primary follow-menu-button"
on:click|preventDefault={request}
on:click|preventDefault={sendFollowRequest}
title="Ask others to follow"><img class="background-img" src={followImg} alt="" /></button
>
{/if}