mirror of
https://github.com/lumehq/lume.git
synced 2025-03-29 03:02:14 +01:00
fixed build error
This commit is contained in:
parent
c8a226eecf
commit
eb440eda1b
@ -1,7 +1,13 @@
|
|||||||
import AppActions from '@components/appHeader/actions';
|
|
||||||
import { NoteConnector } from '@components/note/connector';
|
|
||||||
|
|
||||||
import { PlusIcon } from '@radix-ui/react-icons';
|
import { PlusIcon } from '@radix-ui/react-icons';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
|
|
||||||
|
const AppActions = dynamic(() => import('@components/appHeader/actions'), {
|
||||||
|
ssr: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const NoteConnector = dynamic(() => import('@components/note/connector'), {
|
||||||
|
ssr: false,
|
||||||
|
});
|
||||||
|
|
||||||
export default function AppHeader() {
|
export default function AppHeader() {
|
||||||
return (
|
return (
|
||||||
|
@ -8,12 +8,12 @@ import { dateToUnix } from '@utils/getDate';
|
|||||||
import { createCacheNote, getAllFollowsByID, updateLastLoginTime } from '@utils/storage';
|
import { createCacheNote, getAllFollowsByID, updateLastLoginTime } from '@utils/storage';
|
||||||
import { pubkeyArray } from '@utils/transform';
|
import { pubkeyArray } from '@utils/transform';
|
||||||
|
|
||||||
import { window } from '@tauri-apps/api';
|
|
||||||
import { TauriEvent } from '@tauri-apps/api/event';
|
import { TauriEvent } from '@tauri-apps/api/event';
|
||||||
|
import { appWindow, getCurrent } from '@tauri-apps/api/window';
|
||||||
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
|
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
|
||||||
import { memo, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
export const NoteConnector = memo(function NoteConnector() {
|
export default function NoteConnector() {
|
||||||
const pool: any = useContext(RelayContext);
|
const pool: any = useContext(RelayContext);
|
||||||
|
|
||||||
const setHasNewerNote = useSetAtom(hasNewerNoteAtom);
|
const setHasNewerNote = useSetAtom(hasNewerNoteAtom);
|
||||||
@ -45,9 +45,9 @@ export const NoteConnector = memo(function NoteConnector() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
subscribe();
|
subscribe();
|
||||||
window.getCurrent().listen(TauriEvent.WINDOW_CLOSE_REQUESTED, () => {
|
getCurrent().listen(TauriEvent.WINDOW_CLOSE_REQUESTED, () => {
|
||||||
updateLastLoginTime(now.current);
|
updateLastLoginTime(now.current);
|
||||||
window.appWindow.close();
|
appWindow.close();
|
||||||
});
|
});
|
||||||
}, [activeAccount.id, pool, relays, setHasNewerNote, subscribe]);
|
}, [activeAccount.id, pool, relays, setHasNewerNote, subscribe]);
|
||||||
|
|
||||||
@ -68,4 +68,4 @@ export const NoteConnector = memo(function NoteConnector() {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user