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:
1 parent
58de0df24b
commit
77812f9452
1 file changed
+1
-1
@@ -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