Fix sharing

This commit is contained in:
Joey Yakimowich-Payne 2026-01-16 09:42:12 -07:00
commit 3e9a988748
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
6 changed files with 88 additions and 13 deletions

View file

@ -124,8 +124,8 @@ export const useGame = () => {
if (auth.isLoading) return;
const getTargetPath = () => {
if (location.pathname === '/callback') {
return '/';
if (location.pathname === '/callback' || location.pathname.startsWith('/shared/')) {
return null;
}
switch (gameState) {
@ -162,7 +162,7 @@ export const useGame = () => {
};
const targetPath = getTargetPath();
if (location.pathname !== targetPath) {
if (targetPath !== null && location.pathname !== targetPath) {
const useReplace = ['COUNTDOWN', 'QUESTION', 'REVEAL', 'SCOREBOARD'].includes(gameState);
navigate(targetPath + location.search, { replace: useReplace });
}
@ -519,7 +519,7 @@ export const useGame = () => {
const initializeFromUrl = async () => {
const path = location.pathname;
if (path === '/callback') {
if (path === '/callback' || path.startsWith('/shared/')) {
return;
}