Check version when requesting recipes

This commit is contained in:
Kirill Kamakin
2022-10-29 17:09:42 +02:00
parent 1502d3db9d
commit 17fc2f62bd
9 changed files with 32 additions and 16 deletions

View File

@@ -35,8 +35,8 @@ class BaseURLViewModel @Inject constructor(
logger.v { "checkBaseURL() called with: baseURL = $baseURL" }
val result = runCatchingExceptCancel {
// If it returns proper version info then it must be a Mealie
versionDataSource.getVersionInfo(baseURL)
baseURLStorage.storeBaseURL(baseURL)
val version = versionDataSource.getVersionInfo(baseURL).version
baseURLStorage.storeBaseURL(baseURL, version)
}
logger.i { "checkBaseURL: result is $result" }
_uiState.value = OperationUiState.fromResult(result)