fix: give Explore its own /explore route so PiP navigates back to voice correctly

The Explore page shared /channels/@me with Friends, differentiated by a
showExplore UI flag. When PiP navigated to a voice channel, the stale
flag caused MainContent to render text chat instead of the voice grid.
Replace the flag with a dedicated /explore route so the URL is the
single source of truth.
This commit is contained in:
Jannis Braun
2026-03-05 01:29:16 +01:00
parent b840d2f82b
commit b642989e6e
7 changed files with 25 additions and 23 deletions
@@ -2,14 +2,12 @@ import React, { useEffect, useRef, useState, useCallback, useMemo } from 'react'
import { useNavigate } from 'react-router-dom';
import { useExploreStore, type TaggedExploreServer } from '../../stores/exploreStore';
import { useServerStore } from '../../stores/serverStore';
import { useUIStore } from '../../stores/uiStore';
import { LoadingSpinner } from '../ui/LoadingSpinner';
import { getServerGradient } from '../../utils/gradients';
export function ExplorePage() {
const navigate = useNavigate();
const setCurrentServer = useServerStore((s) => s.setCurrentServer);
const setShowExplore = useUIStore((s) => s.setShowExplore);
const servers = useExploreStore((s) => s.servers);
const myRequests = useExploreStore((s) => s.myRequests);
@@ -47,7 +45,6 @@ export function ExplorePage() {
}, []);
const handleJoinSuccess = (serverId: string) => {
setShowExplore(false);
setCurrentServer(serverId);
navigate(`/channels/${serverId}`);
};