Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
memri
iOS client for Memri
Commits
1f0cf764
Commit
1f0cf764
authored
Jul 29, 2021
by
Chaitanya Pandit
Browse files
Bugfix: App was trying to connect to pod even after selecting local option
parent
d54d9f57
Changes
3
Hide whitespace changes
Inline
Side-by-side
MemriApp/Controllers/AppController.swift
View file @
1f0cf764
...
...
@@ -43,7 +43,7 @@ class AppController: ObservableObject {
let
statePublisher
=
PassthroughSubject
<
AppState
,
Never
>
()
func
updateState
()
{
guard
databaseController
.
databasePool
!=
nil
,
(
try
?
ItemRecord
.
getOwnerAndDBKey
())
!=
nil
else
{
guard
databaseController
.
databasePool
!=
nil
,
databaseController
.
isDatabaseSetup
else
{
state
=
.
setup
statePublisher
.
send
(
state
)
try
?
syncController
.
sync
()
...
...
@@ -73,7 +73,6 @@ class AppController: ObservableObject {
}
self
?
.
databaseController
.
setupDatabase
{
try
?
Authentication
.
createOwnerAndDBKey
()
try
?
self
?
.
databaseController
.
importRequiredData
()
if
(
useDemoData
)
{
try
?
self
?
.
databaseController
.
setupWithDemoData
()
...
...
MemriApp/Controllers/Database/DatabaseController.swift
View file @
1f0cf764
...
...
@@ -287,6 +287,10 @@ extension DatabaseController {
extension
DatabaseController
{
var
isDatabaseSetup
:
Bool
{
return
hasImportedSchema
&&
hasImportedDefaultData
}
/// Check if the database has been setup
var
hasImportedDemoData
:
Bool
{
(
try
?
read
{
db
in
...
...
MemriApp/Controllers/Syncing/SyncController.swift
View file @
1f0cf764
...
...
@@ -59,6 +59,7 @@ class SyncController {
func
sync
(
completion
:
((
Error
?)
->
Void
)?
=
nil
)
throws
{
guard
(
try
?
ItemRecord
.
getOwnerAndDBKey
())
!=
nil
else
{
// Local mode or not setup
throw
StringError
(
description
:
"Not Setup"
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment