mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: adding dexie
This commit is contained in:
parent
d97c5b894a
commit
50028fbfd8
2 changed files with 12 additions and 12 deletions
|
@ -26,7 +26,7 @@ import {
|
||||||
} from "@renderer/features";
|
} from "@renderer/features";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UserFriendModal } from "./pages/shared-modals/user-friend-modal";
|
import { UserFriendModal } from "./pages/shared-modals/user-friend-modal";
|
||||||
import { migrationWorker } from "./workers";
|
// import { migrationWorker } from "./workers";
|
||||||
import { repacksContext } from "./context";
|
import { repacksContext } from "./context";
|
||||||
|
|
||||||
export interface AppProps {
|
export interface AppProps {
|
||||||
|
|
|
@ -90,19 +90,9 @@ export function useUserDetails() {
|
||||||
username: userDetails?.username || "",
|
username: userDetails?.username || "",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[updateUserDetails]
|
[updateUserDetails, userDetails?.username]
|
||||||
);
|
);
|
||||||
|
|
||||||
const fetchFriendRequests = useCallback(async () => {
|
|
||||||
return window.electron
|
|
||||||
.getFriendRequests()
|
|
||||||
.then((friendRequests) => {
|
|
||||||
syncFriendRequests();
|
|
||||||
dispatch(setFriendRequests(friendRequests));
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
}, [dispatch]);
|
|
||||||
|
|
||||||
const syncFriendRequests = useCallback(async () => {
|
const syncFriendRequests = useCallback(async () => {
|
||||||
return window.electron
|
return window.electron
|
||||||
.syncFriendRequests()
|
.syncFriendRequests()
|
||||||
|
@ -112,6 +102,16 @@ export function useUserDetails() {
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
|
const fetchFriendRequests = useCallback(async () => {
|
||||||
|
return window.electron
|
||||||
|
.getFriendRequests()
|
||||||
|
.then((friendRequests) => {
|
||||||
|
syncFriendRequests();
|
||||||
|
dispatch(setFriendRequests(friendRequests));
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}, [dispatch, syncFriendRequests]);
|
||||||
|
|
||||||
const showFriendsModal = useCallback(
|
const showFriendsModal = useCallback(
|
||||||
(initialTab: UserFriendModalTab, userId: string) => {
|
(initialTab: UserFriendModalTab, userId: string) => {
|
||||||
dispatch(setFriendsModalVisible({ initialTab, userId }));
|
dispatch(setFriendsModalVisible({ initialTab, userId }));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue