fix(auth): force activeTab to messages if not authenticated — prevent localStorage carryover
When a user visited the Live tab in a previous session, localStorage stored activeTab: 'live'. On page reload, even with the new auth guard, the app would try to render the Live tab and show the auth overlay. Now if not authenticated, activeTab is always forced to 'messages'.
This commit is contained in:
@@ -40,8 +40,8 @@ export default function App() {
|
||||
const [monitorGuildId, setMonitorGuildId] = useState("");
|
||||
|
||||
const audio = useAudioPlayback();
|
||||
const activeTab = uiState.activeTab || "messages";
|
||||
const isPublicDashboard = import.meta.env.VITE_DASHBOARD_IS_PUBLIC === "true";
|
||||
const activeTab = !authenticated && !isPublicDashboard ? "messages" : uiState.activeTab || "messages";
|
||||
const selectedVoiceGuild =
|
||||
uiState.selectedVoiceGuild || uiState.selectedGuild || "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user