Ensure app environment is configured

This can happen if a user sets a custom self hosting environment,
then deletes and re-installs the app.
This commit is contained in:
Jackson Harper
2024-01-04 10:59:36 +08:00
parent 8a288ffe5f
commit 4689b5325f
2 changed files with 12 additions and 1 deletions

View File

@ -54,6 +54,17 @@ public extension AppEnvironment {
)
}
var environmentConfigured: Bool {
if self == .custom {
if let str = UserDefaults.standard.string(forKey: AppEnvironmentUserDefaultKey.webAppBaseURL.rawValue), let url = URL(string: str) {
return true
} else {
return false
}
}
return true
}
var graphqlPath: String {
"\(serverBaseURL.absoluteString)/api/graphql"
}