1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-04-27 19:05:16 +00:00

set exdraw favicon (#7742)

This commit is contained in:
zhichaona 2025-04-17 10:31:17 +08:00 committed by GitHub
parent b398c493c2
commit a524757a92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 (
<SimpleEditor
isFetching={isFetching}