change document titles on load

This commit is contained in:
SethBurkart123
2024-05-08 20:50:40 +10:00
parent f383ab75af
commit 80374bc9d0
+4 -4
View File
@@ -27,17 +27,17 @@ const Theme = () => {
useEffect(() => { useEffect(() => {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
document.title = 'BetterSEQTA+' // Reset the title
const themeID = urlParams.get('id'); const themeID = urlParams.get('id');
const justCreated = urlParams.get('justCreated'); const justCreated = urlParams.get('justCreated');
if (themeID) { if (themeID) setThemeID(themeID);
setThemeID(themeID);
}
const getTheme = async (themeID: string) => { const getTheme = async (themeID: string) => {
const theme = await pb.collection<ThemesRecord>('themes').getOne(themeID); const theme = await pb.collection<ThemesRecord>('themes').getOne(themeID);
console.debug(theme); console.debug(theme);
setIsLoading(false); setIsLoading(false);
setTheme(theme); setTheme(theme);
document.title = theme.name;
const availableThemes = await localforage.getItem('availableThemes') as string[]; const availableThemes = await localforage.getItem('availableThemes') as string[];
setCurrentThemes(availableThemes) setCurrentThemes(availableThemes)