diff --git a/web/index.html b/web/index.html
index 5de864d..40252d6 100644
--- a/web/index.html
+++ b/web/index.html
@@ -2,7 +2,7 @@
-
+
gomuks web
diff --git a/web/src/api/types/preferences/preferences.ts b/web/src/api/types/preferences/preferences.ts
index 9f7e253..94e8764 100644
--- a/web/src/api/types/preferences/preferences.ts
+++ b/web/src/api/types/preferences/preferences.ts
@@ -183,6 +183,12 @@ export const preferences = {
allowedContexts: anyGlobalContext,
defaultValue: "gomuks web",
}),
+ favicon: new Preference({
+ displayName: "Favicon",
+ description: "The URL to use for the favicon.",
+ allowedContexts: anyContext,
+ defaultValue: "gomuks.png",
+ }),
} as const
export const existingPreferenceKeys = new Set(Object.keys(preferences))
diff --git a/web/src/ui/StylePreferences.tsx b/web/src/ui/StylePreferences.tsx
index b410598..8c2da2b 100644
--- a/web/src/ui/StylePreferences.tsx
+++ b/web/src/ui/StylePreferences.tsx
@@ -13,7 +13,7 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
-import React, { useInsertionEffect } from "react"
+import React, { useEffect, useInsertionEffect } from "react"
import type Client from "@/api/client.ts"
import { RoomStateStore, usePreferences } from "@/api/statestore"
@@ -128,7 +128,12 @@ const StylePreferences = ({ client, activeRoom }: StylePreferencesProps) => {
@import url("_gomuks/codeblock/${preferences.code_block_theme}.css");
`, [preferences.code_block_theme], "gomuks-pref-code-block-theme")
useAsyncStyle(() => preferences.custom_css, [preferences.custom_css], "gomuks-pref-custom-css")
+ useEffect(() => {
+ favicon.href = preferences.favicon
+ }, [preferences.favicon])
return null
}
+const favicon = document.getElementById("favicon") as HTMLLinkElement
+
export default React.memo(StylePreferences)