mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
change document titles on load
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user