mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
change document titles on load
This commit is contained in:
@@ -27,17 +27,17 @@ const Theme = () => {
|
||||
|
||||
useEffect(() => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
document.title = 'BetterSEQTA+' // Reset the title
|
||||
const themeID = urlParams.get('id');
|
||||
const justCreated = urlParams.get('justCreated');
|
||||
if (themeID) {
|
||||
setThemeID(themeID);
|
||||
}
|
||||
if (themeID) setThemeID(themeID);
|
||||
|
||||
const getTheme = async (themeID: string) => {
|
||||
const theme = await pb.collection<ThemesRecord>('themes').getOne(themeID);
|
||||
console.debug(theme);
|
||||
setIsLoading(false);
|
||||
setTheme(theme);
|
||||
document.title = theme.name;
|
||||
|
||||
const availableThemes = await localforage.getItem('availableThemes') as string[];
|
||||
setCurrentThemes(availableThemes)
|
||||
|
||||
Reference in New Issue
Block a user