diff --git a/front/src/Components/FollowMenu/FollowMenu.svelte b/front/src/Components/FollowMenu/FollowMenu.svelte
index 59194db2..6506b1d6 100644
--- a/front/src/Components/FollowMenu/FollowMenu.svelte
+++ b/front/src/Components/FollowMenu/FollowMenu.svelte
@@ -18,40 +18,6 @@ vim: ft=typescript
const gameScene = gameManager.getCurrentGameScene();
- let followState: string;
- let followRole: string;
- let followUsers: number[];
- let stateUnsubscriber: Unsubscriber;
- let roleUnsubscriber: Unsubscriber;
- let nameUnsubscriber: Unsubscriber;
-
- onMount(() => {
- followState = get(followStateStore);
- followRole = get(followRoleStore);
- followUsers = get(followUsersStore);
- stateUnsubscriber = followStateStore.subscribe((state) => {
- followState = state;
- });
- roleUnsubscriber = followRoleStore.subscribe((role) => {
- followRole = role;
- });
- nameUnsubscriber = followUsersStore.subscribe((users) => {
- followUsers = users;
- });
- });
-
- onDestroy(() => {
- if (stateUnsubscriber) {
- stateUnsubscriber();
- }
- if (roleUnsubscriber) {
- roleUnsubscriber();
- }
- if (nameUnsubscriber) {
- nameUnsubscriber();
- }
- });
-
function name(userId: number): string | undefined {
return gameScene.MapPlayersByKey.get(userId)?.PlayerValue;
}
@@ -85,11 +51,11 @@ vim: ft=typescript
Following {name(followUsers[0])}
- {:else if followUsers.length === 0} + {#if $followRoleStore === followRoles.follower} +Following {name($followUsersStore[0])}
+ {:else if $followUsersStore.length === 0}Waiting for followers' confirmation
- {:else if followUsers.length === 1} -{name(followUsers[0])} is following you
- {:else if followUsers.length === 2} -{name(followUsers[0])} and {name(followUsers[1])} are following you
+ {:else if $followUsersStore.length === 1} +{name($followUsersStore[0])} is following you
+ {:else if $followUsersStore.length === 2} +{name($followUsersStore[0])} and {name($followUsersStore[1])} are following you
{:else}- {followUsers.slice(0, -1).map(name).join(", ")} and {name(followUsers[followUsers.length - 1])} are following + {$followUsersStore.slice(0, -1).map(name).join(", ")} and {name($followUsersStore[$followUsersStore.length - 1])} are following you
{/if} @@ -147,7 +113,7 @@ vim: ft=typescript