mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 05:25:53 +08:00
@@ -39,7 +39,9 @@ export function createApplicationMenu() {
|
||||
label: `About ${app.getName()}`,
|
||||
click: async () => {
|
||||
await showMainWindow();
|
||||
applicationMenuSubjects.openInSettingModal$.next('about');
|
||||
applicationMenuSubjects.openInSettingModal$.next({
|
||||
activeTab: 'about',
|
||||
});
|
||||
},
|
||||
},
|
||||
{ type: 'separator' },
|
||||
|
||||
@@ -18,7 +18,9 @@ export const applicationMenuEvents = {
|
||||
};
|
||||
},
|
||||
// todo: properly define the active tab type
|
||||
openInSettingModal: (fn: (activeTab: string) => void) => {
|
||||
openInSettingModal: (
|
||||
fn: (props: { activeTab: string; scrollAnchor?: string }) => void
|
||||
) => {
|
||||
const sub = applicationMenuSubjects.openInSettingModal$.subscribe(fn);
|
||||
return () => {
|
||||
sub.unsubscribe();
|
||||
|
||||
@@ -3,5 +3,8 @@ import { Subject } from 'rxjs';
|
||||
export const applicationMenuSubjects = {
|
||||
newPageAction$: new Subject<'page' | 'edgeless'>(),
|
||||
openJournal$: new Subject<void>(),
|
||||
openInSettingModal$: new Subject<string>(),
|
||||
openInSettingModal$: new Subject<{
|
||||
activeTab: string;
|
||||
scrollAnchor?: string;
|
||||
}>(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user