fix: explore tab first-click navigation and misleading empty state
Clear stale currentChannelId when clicking Explore/DMs in ServerSidebar, and guard AppLayout route effect from clobbering showExplore. Move member exclusion into SQL for correct pagination/totals, surface allSettled errors, and show context-aware empty state messages.
This commit is contained in:
@@ -15,6 +15,7 @@ export function ExplorePage() {
|
||||
const myRequests = useExploreStore((s) => s.myRequests);
|
||||
const isLoading = useExploreStore((s) => s.isLoading);
|
||||
const discoveryEnabled = useExploreStore((s) => s.discoveryEnabled);
|
||||
const totalAll = useExploreStore((s) => s.totalAll);
|
||||
const error = useExploreStore((s) => s.error);
|
||||
const searchQuery = useExploreStore((s) => s.searchQuery);
|
||||
const setSearchQuery = useExploreStore((s) => s.setSearchQuery);
|
||||
@@ -106,7 +107,11 @@ export function ExplorePage() {
|
||||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z" />
|
||||
</svg>
|
||||
<p className="text-txt-tertiary text-sm">
|
||||
{searchQuery ? 'No servers match your search.' : 'No discoverable servers found.'}
|
||||
{searchQuery
|
||||
? 'No servers match your search.'
|
||||
: totalAll > 0
|
||||
? `You've already joined all ${totalAll} discoverable server${totalAll === 1 ? '' : 's'}.`
|
||||
: 'No servers have been made discoverable yet.'}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user