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