Skip to content

Commit

Permalink
Tick hack (#4577)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianjelfs authored Oct 13, 2023
1 parent 0b60bb1 commit 94f8417
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions frontend/app/src/components/home/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@
: "OpenChat";
}
$: {
tick().then(() => {
routeChange($chatsInitialised, $pathParams);
});
}
onMount(() => {
subscribeToNotifications(client, (n) => client.notificationReceived(n));
client.addEventListener("openchat_event", clientEvent);
Expand Down Expand Up @@ -343,13 +349,12 @@
if (
!$mobileWidth &&
(pathParams.kind === "selected_community_route" ||
pathParams.kind === "chat_list_route")
pathParams.kind === "chat_list_route") &&
$chatSummariesListStore.length > 0
) {
const first = $chatSummariesListStore.find((c) => !c.membership.archived);
if (first !== undefined) {
page.redirect(routeForChatIdentifier($chatListScope.kind, first.id));
return;
}
const first = $chatSummariesListStore[0];
page.redirect(routeForChatIdentifier($chatListScope.kind, first.id));
return;
}
if (pathParams.kind === "home_route") {
Expand Down Expand Up @@ -445,10 +450,6 @@
}
}
$: {
routeChange($chatsInitialised, $pathParams);
}
// Note: very important (and hacky) that this is hidden in a function rather than inline in the top level reactive
// statement because we don't want that reactive statement to execute in reponse to changes in rightPanelHistory :puke:
function filterChatSpecificRightPanelStates() {
Expand Down

0 comments on commit 94f8417

Please sign in to comment.