From a524757a92648b8274265db694068ccd8895801f Mon Sep 17 00:00:00 2001 From: zhichaona <1255628593@qq.com> Date: Thu, 17 Apr 2025 10:31:17 +0800 Subject: [PATCH] set exdraw favicon (#7742) --- frontend/src/pages/excalidraw-editor/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/pages/excalidraw-editor/index.js b/frontend/src/pages/excalidraw-editor/index.js index 02b34740a8..20c45bc1b1 100644 --- a/frontend/src/pages/excalidraw-editor/index.js +++ b/frontend/src/pages/excalidraw-editor/index.js @@ -5,6 +5,7 @@ import isHotkey from 'is-hotkey'; import { gettext } from '../../utils/constants'; import toaster from '../../components/toast'; import { SAVE_INTERVAL_TIME } from './constants'; +import { Utils } from '../../utils/utils'; import './index.css'; @@ -23,6 +24,7 @@ const ExcaliEditor = () => { setFileContent(res.data); setIsFetching(false); }); + onSetFavicon(); }, []); const saveSceneContent = useCallback(async () => { @@ -83,6 +85,12 @@ const ExcaliEditor = () => { isChangedRef.current = true; }, []); + const onSetFavicon = useCallback(() => { + const { docName } = window.app.pageOptions; + const fileIcon = Utils.getFileIconUrl(docName); + document.getElementById('favicon').href = fileIcon; + }, []); + return (