Fix sharing
This commit is contained in:
parent
1bfe7e3437
commit
3e9a988748
6 changed files with 88 additions and 13 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue