fix: nav buttons now navigate, not just toggle store state
The [S] button only called setDM(false) without navigating away from
/chat area. Since the notes-to-self feature now calls navigate('/dm/:id'),
the URL stayed at /dm/... and ChatArea never re-mounted.
[S] now navigates to /, [@] navigates to /dm.
This commit is contained in:
@@ -120,7 +120,7 @@ export function Layout() {
|
|||||||
<div className="flex-1 flex min-h-0">
|
<div className="flex-1 flex min-h-0">
|
||||||
<div className="flex flex-col items-center w-16 bg-gb-bg-h border-r border-gb-bg-t py-2 gap-2 shrink-0">
|
<div className="flex flex-col items-center w-16 bg-gb-bg-h border-r border-gb-bg-t py-2 gap-2 shrink-0">
|
||||||
<button
|
<button
|
||||||
onClick={() => setDM(false)}
|
onClick={() => { setDM(false); navigate('/'); }}
|
||||||
className={`w-11 h-11 flex items-center justify-center font-mono text-xs border rounded ${
|
className={`w-11 h-11 flex items-center justify-center font-mono text-xs border rounded ${
|
||||||
!isDM
|
!isDM
|
||||||
? 'bg-gb-bg-t text-gb-orange border-gb-orange'
|
? 'bg-gb-bg-t text-gb-orange border-gb-orange'
|
||||||
@@ -134,6 +134,7 @@ export function Layout() {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDM(true);
|
setDM(true);
|
||||||
setActiveServer(null);
|
setActiveServer(null);
|
||||||
|
navigate('/dm');
|
||||||
}}
|
}}
|
||||||
className={`w-11 h-11 flex items-center justify-center font-mono text-xs border rounded ${
|
className={`w-11 h-11 flex items-center justify-center font-mono text-xs border rounded ${
|
||||||
isDM
|
isDM
|
||||||
|
|||||||
Reference in New Issue
Block a user