Authenticating...
}diff --git a/src/App.js b/src/App.js index c60d3e2..a51e5f6 100644 --- a/src/App.js +++ b/src/App.js @@ -38,14 +38,15 @@ if (missingKeys.length > 0) { const APP_ID = process.env.REACT_APP_TRACKER_APP_ID || 'ttrpg-initiative-tracker-default'; const PUBLIC_DATA_PATH = `artifacts/${APP_ID}/public/data`; const CAMPAIGNS_COLLECTION = `${PUBLIC_DATA_PATH}/campaigns`; -const ACTIVE_DISPLAY_DOC = `${PUBLIC_DATA_PATH}/activeDisplay/status`; +const ACTIVE_DISPLAY_DOC = `${PUBLIC_DATA_PATH}/activeDisplay/status`; // Single source for what player display shows // --- Helper Functions --- const generateId = () => crypto.randomUUID(); -function getShareableLinkBase() { - return window.location.origin + window.location.pathname; -} +// getShareableLinkBase is no longer needed for individual encounter links if we have one player display URL +// function getShareableLinkBase() { +// return window.location.origin + window.location.pathname; +// } // --- Main App Component --- function App() { @@ -54,7 +55,7 @@ function App() { const [viewMode, setViewMode] = useState('admin'); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); - const [directDisplayParams, setDirectDisplayParams] = useState(null); + // directDisplayParams and hash routing removed, Player Display solely relies on ACTIVE_DISPLAY_DOC useEffect(() => { if (!auth) { @@ -63,22 +64,6 @@ function App() { setIsAuthReady(false); return; } - const handleHashChange = () => { - const hash = window.location.hash; - if (hash.startsWith('#/display/')) { - const parts = hash.substring('#/display/'.length).split('/'); - if (parts.length === 2 && parts[0] && parts[1]) { - setDirectDisplayParams({ campaignId: parts[0], encounterId: parts[1] }); - setViewMode('display'); - } else { - setDirectDisplayParams(null); - } - } else { - setDirectDisplayParams(null); - } - }; - window.addEventListener('hashchange', handleHashChange); - handleHashChange(); const initAuth = async () => { try { @@ -101,7 +86,6 @@ function App() { }); initAuth(); return () => { - window.removeEventListener('hashchange', handleHashChange); unsubscribe(); }; }, []); @@ -131,13 +115,10 @@ function App() { const goToAdminView = () => { setViewMode('admin'); - setDirectDisplayParams(null); - window.location.hash = ''; }; return (
Authenticating...
}No encounters yet.
}Participants: {encounter.participants?.length || 0}
- {isDmActiveDisplay && LIVE ON DM DISPLAY} + {isLiveOnPlayerDisplay && LIVE ON PLAYER DISPLAY}Shareable Link for Players:
-The Dungeon Master has not activated an encounter for display.
+