Tim Glasgow
2 years ago
9 changed files with 34 additions and 31 deletions
@ -1,8 +1,8 @@ |
|||||
import { createRef } from "react"; |
import { createRef } from "react"; |
||||
|
|
||||
export const mainRef = createRef(); |
export const MainRef = createRef(); |
||||
|
|
||||
export function navigate(name, params) { |
export function navigate(name, params) { |
||||
mainRef.current?.navigate(name, params); |
MainRef.current?.navigate(name, params); |
||||
return true; |
return true; |
||||
} |
} |
@ -1,21 +1,20 @@ |
|||||
import { initDB } from "../../realm/dbInit"; |
import { initDB } from "../../realm/DbInit"; |
||||
import dbAPI from "../../realm/dbAPI"; |
import DbAPI from "../../realm/DbAPI"; |
||||
import { APP_INIT } from "../types/SystemTypes"; |
import { APP_INIT } from "../types/SystemTypes"; |
||||
|
|
||||
export function appInit() { |
export function appInit() { |
||||
return async (dispatch) => { |
return async (dispatch) => { |
||||
await dbAPI.initDB(); |
await DbAPI.initDB(); |
||||
dispatch(onInit()); |
dispatch(onInit()); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
function onInit() { |
function onInit() { |
||||
return (dispatch) => { |
return (dispatch, getState) => { |
||||
|
let system = getState().system; |
||||
dispatch({ |
dispatch({ |
||||
type: APP_INIT |
type: APP_INIT, |
||||
//system: system
|
system: system |
||||
//user: user
|
|
||||
//score: score
|
|
||||
}); |
}); |
||||
} |
} |
||||
} |
} |
Loading…
Reference in new issue