mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat: open about page in setting modal when click about menu (#6245)
Co-authored-by: EYHN <cneyhn@gmail.com>
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import { events } from '@affine/electron-api';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useAtom } from 'jotai';
|
||||
import { lazy, type ReactElement, Suspense, useCallback } from 'react';
|
||||
import {
|
||||
lazy,
|
||||
type ReactElement,
|
||||
Suspense,
|
||||
useCallback,
|
||||
useEffect,
|
||||
} from 'react';
|
||||
|
||||
import {
|
||||
authAtom,
|
||||
@@ -116,6 +123,18 @@ export const Setting = () => {
|
||||
[setOpenSettingModalAtom]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (environment.isDesktop) {
|
||||
return events?.applicationMenu.openAboutPageInSettingModal(() =>
|
||||
setOpenSettingModalAtom({
|
||||
activeTab: 'about',
|
||||
open: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
return;
|
||||
}, [setOpenSettingModalAtom]);
|
||||
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user