feat: adding auth window

This commit is contained in:
Chubby Granny Chaser 2024-06-20 13:22:12 +01:00
parent 884ba47b9b
commit 71d79a4a15
No known key found for this signature in database
9 changed files with 51 additions and 10 deletions

View file

@ -113,7 +113,7 @@ export function App() {
return () => {
listeners.forEach((unsubscribe) => unsubscribe());
};
}, [fetchUserDetails, updateUserDetails, clearUserDetails]);
}, [fetchUserDetails, updateUserDetails, updateLibrary, clearUserDetails]);
const handleSearch = useCallback(
(query: string) => {

View file

@ -12,7 +12,7 @@ export function SidebarProfile() {
const handleButtonClick = () => {
if (userDetails === null) {
window.electron.openExternal("https://auth.hydra.losbroxas.org");
window.electron.openAuthWindow();
return;
}

View file

@ -115,6 +115,7 @@ declare global {
/* Auth */
signOut: () => Promise<void>;
openAuthWindow: () => Promise<void>;
onSignIn: (cb: () => void) => () => Electron.IpcRenderer;
onSignOut: (cb: () => void) => () => Electron.IpcRenderer;