Reopen the last DM that was open when navigating back to chat (#81)

#60

Co-authored-by: mplorentz <mplorentz@users.noreply.github.com>
Reviewed-on: #81
Co-authored-by: Matt Lorentz <mplorentz@noreply.coracle.social>
Co-committed-by: Matt Lorentz <mplorentz@noreply.coracle.social>
This commit is contained in:
2026-02-19 18:31:54 +00:00
committed by Jon Staab
parent 482121db5c
commit bc864b29f8
3 changed files with 12 additions and 6 deletions
+3 -5
View File
@@ -1,6 +1,5 @@
<script lang="ts">
import type {Snippet} from "svelte"
import {goto} from "$app/navigation"
import {splitAt} from "@welshman/lib"
import {userProfile} from "@welshman/app"
import Widget from "@assets/icons/widget.svg?dataurl"
@@ -19,6 +18,7 @@
import {userSpaceUrls, PLATFORM_RELAYS, PLATFORM_LOGO} from "@app/core/state"
import {pushModal} from "@app/util/modal"
import {notifications} from "@app/util/notifications"
import {goToLastChat} from "@app/util/routes"
type Props = {
children?: Snippet
@@ -28,8 +28,6 @@
const showSettingsMenu = () => pushModal(MenuSettings)
const openChat = () => goto("/chat")
let windowHeight = $state(0)
const itemHeight = 56
@@ -85,7 +83,7 @@
</PrimaryNavItem>
<PrimaryNavItem
title="Messages"
onclick={openChat}
onclick={goToLastChat}
class="tooltip-right"
notification={$notifications.has("/chat")}>
<ImageIcon alt="Messages" src={Letter} size={8} />
@@ -112,7 +110,7 @@
</PrimaryNavItem>
<PrimaryNavItem
title="Messages"
onclick={openChat}
onclick={goToLastChat}
notification={$notifications.has("/chat")}>
<ImageIcon alt="Messages" src={Letter} size={8} />
</PrimaryNavItem>