trying to get realm connected
This commit is contained in:
@@ -8,6 +8,9 @@ import { SnackbarProvider } from 'notistack';
|
|||||||
import { NirvanaTheme } from './mui/NirvanaTheme';
|
import { NirvanaTheme } from './mui/NirvanaTheme';
|
||||||
import { ElectronProvider } from './providers/ElectronProvider';
|
import { ElectronProvider } from './providers/ElectronProvider';
|
||||||
import { AuthProvider } from './providers/AuthProvider';
|
import { AuthProvider } from './providers/AuthProvider';
|
||||||
|
import realmApp from './realm/connect';
|
||||||
|
|
||||||
|
realmApp;
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
||||||
root.render(
|
root.render(
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ const createWindow = (): void => {
|
|||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
|
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
contextIsolation: false,
|
|
||||||
},
|
},
|
||||||
// titleBarStyle: "hiddenInset",
|
// titleBarStyle: "hiddenInset",
|
||||||
frame: false,
|
frame: false,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Button, Container } from '@mui/material';
|
import { Button, Container } from '@mui/material';
|
||||||
import React, { useContext, useEffect, useCallback } from 'react';
|
import React, { useContext, useEffect, useCallback } from 'react';
|
||||||
import Realm from 'realm';
|
import Realm from 'realm';
|
||||||
import realmApp from '../realm/connect';
|
|
||||||
|
|
||||||
import { FcGoogle } from 'react-icons/fc';
|
import { FcGoogle } from 'react-icons/fc';
|
||||||
import { blueGrey } from '@mui/material/colors';
|
import { blueGrey } from '@mui/material/colors';
|
||||||
@@ -17,7 +16,7 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.electronAPI.once(Channels.GOOGLE_AUTH_TOKENS, async (tokens: any) => {
|
window.electronAPI.once(Channels.GOOGLE_AUTH_TOKENS, async (tokens: any) => {
|
||||||
console.log('got tokens', tokens);
|
console.log('got tokens', tokens);
|
||||||
// const credentials = Realm.Credentials.google(tokens);
|
|
||||||
// realmApp.logIn(credentials).then((user) => alert(`Logged in with id: ${user.id}`));
|
// realmApp.logIn(credentials).then((user) => alert(`Logged in with id: ${user.id}`));
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -2,10 +2,16 @@ import Realm from 'realm';
|
|||||||
|
|
||||||
const id = 'nirvana-ouauo';
|
const id = 'nirvana-ouauo';
|
||||||
|
|
||||||
const config = {
|
const realmApp = new Realm.App({ id });
|
||||||
id,
|
|
||||||
};
|
|
||||||
|
|
||||||
const realmApp = new Realm.App(config);
|
async function run() {
|
||||||
|
const config = {
|
||||||
|
id,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
run().catch((err) => {
|
||||||
|
console.error('Failed to open realm:', err);
|
||||||
|
});
|
||||||
|
|
||||||
export default realmApp;
|
export default realmApp;
|
||||||
|
|||||||
Reference in New Issue
Block a user