Open ahmadtlz opened 4 years ago
Hey @dking01, I made a workaround, verifying if the connection exists and if it's connected before create a new one.
const exists = manager.has('default')
let conn: Connection
if (exists) {
const defaultConn = manager.get('default')
if (defaultConn) {
conn = defaultConn
if (!conn.isConnected) {
await conn.connect()
}
}
} else {
conn = manager.create({
name: 'default',
type: 'react-native',
database: 'myappdb',
location: 'default',
logging: ['error', 'query', 'schema'],
synchronize: true,
entities: [
Entity
]
})
await conn.connect()
hi , the first time i reload the app (ctrl+m ==> reload )is work perfect but when i exit the app and again run it the warning popup i wanna close the connection but i don't no how :( this is my code in react-native App