fix: dock app badge shows incorrect number
Closes #122 We now only show number based on open streams
This commit is contained in:
@@ -18,6 +18,7 @@ import { particlePath } from "@/lib/particle-path";
|
||||
import { useParticle } from "@/hooks/use-particle";
|
||||
import type { Particle } from "@/api/types";
|
||||
import { PropsWithChildren, useCallback } from "react";
|
||||
import { useDockBadge } from "@/hooks/use-dock-badge";
|
||||
import { toast } from "sonner";
|
||||
|
||||
function getParticleDisplayName(particle: Particle): string {
|
||||
@@ -170,6 +171,9 @@ function TopBar() {
|
||||
}
|
||||
|
||||
export default function Layout({ children }: PropsWithChildren) {
|
||||
const { networkId } = useParams();
|
||||
useDockBadge(networkId);
|
||||
|
||||
return (
|
||||
<div className="flex h-screen flex-col">
|
||||
<TopBar />
|
||||
|
||||
@@ -8,8 +8,6 @@ import { ComposeOverlay } from "./compose/compose-overlay";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { useStreamParticles } from "@/hooks/use-stream-particles";
|
||||
import { useStreamKeyboardNav } from "@/hooks/use-stream-keyboard-nav";
|
||||
import { useDockBadge } from "@/hooks/use-dock-badge";
|
||||
import { useAuthStore } from "@/stores/auth-store";
|
||||
|
||||
/**
|
||||
* Route-level component for /:networkId (index).
|
||||
@@ -21,8 +19,6 @@ export default function NetworkRoot() {
|
||||
const path = particlePath(networkId!, []);
|
||||
|
||||
const { streams, isLoading } = useStreamParticles(path);
|
||||
const userId = useAuthStore((s) => s.user?.id);
|
||||
useDockBadge(streams, userId);
|
||||
const [composeActive, setComposeActive] = useState(false);
|
||||
const [statusTab, setStatusTab] = useState<"open" | "closed">("open");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user