diff --git a/src/layout/RootLayout/Footer.tsx b/src/layout/RootLayout/Footer.tsx index 6f0854c..660e56d 100644 --- a/src/layout/RootLayout/Footer.tsx +++ b/src/layout/RootLayout/Footer.tsx @@ -15,13 +15,20 @@ const linkStyle = { }, }; +const gitSha = import.meta.env.VITE_GIT_SHA; + const links = [ { text: 'GitHub', url: 'https://github.com/coder13/delegateDashboard' }, { text: 'Contact', url: 'mailto:choover11@gmail.com' }, - { - text: `${import.meta.env.VITE_GIT_SHA}`, - url: `https://github.com/coder13/delegateDashboard/commit/${import.meta.env.VITE_GIT_SHA}`, - }, + // Netlify/preview builds sometimes don't provide VITE_GIT_SHA; avoid showing "undefined". + ...(gitSha + ? [ + { + text: gitSha, + url: `https://github.com/coder13/delegateDashboard/commit/${gitSha}`, + }, + ] + : []), ]; const Footer = () => { diff --git a/src/providers/AuthProvider/AuthProvider.tsx b/src/providers/AuthProvider/AuthProvider.tsx index b9af666..53d1c7d 100644 --- a/src/providers/AuthProvider/AuthProvider.tsx +++ b/src/providers/AuthProvider/AuthProvider.tsx @@ -64,6 +64,10 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { useEffect(() => { const hash = window.location.hash.replace(/^#/, ''); + if (!hash) { + return; + } + if (!hash) { return; @@ -86,6 +90,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { /* Clear the hash if there is a token. */ if (hashParams.has('access_token')) { // history.replace({ ...history.location, hash: null }); + console.log(93); navigate({ pathname: '/', hash: '', diff --git a/src/store/actions.ts b/src/store/actions.ts index 3445fcc..729e486 100644 --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -158,7 +158,8 @@ export const uploadCurrentWCIFChanges = return; } - const changes = pick(wcif, Array.from(changedKeys)); + const keysForPatch = ["formatVersion", ...Array.from(changedKeys)]; + const changes = pick(wcif, keysForPatch); dispatch(updateUploading(true)); patchWcif(competitionId, changes)