Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
726c4a73dc
|
||
|
|
191f221faa
|
+1
-1
@@ -121,5 +121,5 @@ dependencies {
|
|||||||
implementation 'androidx.security:security-crypto:1.1.0'
|
implementation 'androidx.security:security-crypto:1.1.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.11.0'
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.11.0'
|
||||||
implementation "androidx.datastore:datastore-preferences:1.2.1"
|
implementation "androidx.datastore:datastore-preferences:1.2.1"
|
||||||
implementation "com.google.crypto.tink:tink-android:1.23.0"
|
implementation "com.google.crypto.tink:tink-android:1.22.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ class EditBillViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun isFormValid(): Boolean {
|
fun isFormValid(): Boolean {
|
||||||
return what.isNotEmpty() && !what.contains(",") &&
|
return what.isNotEmpty() &&
|
||||||
timestamp != 0L &&
|
timestamp != 0L &&
|
||||||
payerId != 0L &&
|
payerId != 0L &&
|
||||||
owersSelection.any { it.value }
|
owersSelection.any { it.value }
|
||||||
@@ -255,7 +255,7 @@ class EditBillViewModel : ViewModel() {
|
|||||||
errorInvalidForm: String
|
errorInvalidForm: String
|
||||||
): String? {
|
): String? {
|
||||||
return when {
|
return when {
|
||||||
what.isEmpty() || what.contains(",") -> errorWhat
|
what.isEmpty() -> errorWhat
|
||||||
timestamp == 0L -> errorDate
|
timestamp == 0L -> errorDate
|
||||||
payerId == 0L -> errorPayer
|
payerId == 0L -> errorPayer
|
||||||
owersSelection.none { it.value } -> errorOwers
|
owersSelection.none { it.value } -> errorOwers
|
||||||
|
|||||||
@@ -165,16 +165,8 @@ class NewProjectActivity : AppCompatActivity() {
|
|||||||
null, false, DBProject.ACCESS_LEVEL_UNKNOWN,
|
null, false, DBProject.ACCESS_LEVEL_UNKNOWN,
|
||||||
""
|
""
|
||||||
)
|
)
|
||||||
|
|
||||||
if (isValidUrl(url) && todoCreate && ProjectType.COSPEND == type &&
|
|
||||||
db.cowspentServerSyncHelper.canCreateAuthenticatedProject(fakeProj) &&
|
|
||||||
!viewModel.showAuthWarningDialog // Avoid infinite loop
|
|
||||||
) {
|
|
||||||
viewModel.showAuthWarningDialog = true
|
|
||||||
} else {
|
|
||||||
createProject()
|
createProject()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun getFormattedUrl(): String {
|
private fun getFormattedUrl(): String {
|
||||||
var url = viewModel.projectUrl.trim()
|
var url = viewModel.projectUrl.trim()
|
||||||
|
|||||||
Reference in New Issue
Block a user