mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-21 15:05:19 +00:00
[SES-2694] Incorrect back press warning message (#1657)
This commit is contained in:
parent
cef47df0e4
commit
a6886f1375
@ -38,7 +38,8 @@ local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https:/
|
||||
pull: 'always',
|
||||
environment: { ANDROID_HOME: '/usr/lib/android-sdk' },
|
||||
commands: [
|
||||
'apt-get install -y ninja-build',
|
||||
'apt-get install -y ninja-build openjdk-17-jdk',
|
||||
'update-java-alternatives -s java-1.17.0-openjdk-amd64',
|
||||
'./gradlew testPlayDebugUnitTestCoverageReport'
|
||||
],
|
||||
}
|
||||
@ -78,7 +79,8 @@ local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https:/
|
||||
pull: 'always',
|
||||
environment: { SSH_KEY: { from_secret: 'SSH_KEY' }, ANDROID_HOME: '/usr/lib/android-sdk' },
|
||||
commands: [
|
||||
'apt-get install -y ninja-build',
|
||||
'apt-get install -y ninja-build openjdk-17-jdk',
|
||||
'update-java-alternatives -s java-1.17.0-openjdk-amd64',
|
||||
'./gradlew assemblePlayDebug',
|
||||
'./scripts/drone-static-upload.sh'
|
||||
],
|
||||
|
@ -17,7 +17,7 @@ import org.thoughtcrime.securesms.ui.theme.LocalColors
|
||||
@Composable
|
||||
fun OnboardingBackPressAlertDialog(
|
||||
dismissDialog: () -> Unit,
|
||||
@StringRes textId: Int = R.string.onboardingBackAccountCreation,
|
||||
@StringRes textId: Int,
|
||||
quit: () -> Unit
|
||||
) {
|
||||
val c = LocalContext.current
|
||||
|
@ -53,7 +53,12 @@ internal fun MessageNotificationsScreen(
|
||||
return
|
||||
}
|
||||
|
||||
if (state.showDialog) OnboardingBackPressAlertDialog(dismissDialog, quit = quit)
|
||||
if (state.showingBackWarningDialogText != null) {
|
||||
OnboardingBackPressAlertDialog(dismissDialog,
|
||||
textId = state.showingBackWarningDialogText,
|
||||
quit = quit
|
||||
)
|
||||
}
|
||||
|
||||
Column {
|
||||
Spacer(Modifier.weight(1f))
|
||||
|
@ -14,6 +14,7 @@ import kotlinx.coroutines.flow.asSharedFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import network.loki.messenger.R
|
||||
import org.session.libsession.utilities.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.ApplicationContext
|
||||
import org.thoughtcrime.securesms.notifications.PushRegistry
|
||||
@ -58,14 +59,16 @@ internal class MessageNotificationsViewModel(
|
||||
fun onBackPressed(): Boolean = when (state) {
|
||||
is State.CreateAccount -> false
|
||||
is State.LoadAccount -> {
|
||||
_uiStates.update { it.copy(showDialog = true) }
|
||||
_uiStates.update { it.copy(showingBackWarningDialogText = R.string.onboardingBackLoadAccount) }
|
||||
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
fun dismissDialog() {
|
||||
_uiStates.update { it.copy(showDialog = false) }
|
||||
_uiStates.update {
|
||||
it.copy(showingBackWarningDialogText = null)
|
||||
}
|
||||
}
|
||||
|
||||
fun quit() {
|
||||
@ -78,7 +81,7 @@ internal class MessageNotificationsViewModel(
|
||||
|
||||
data class UiState(
|
||||
val pushEnabled: Boolean = true,
|
||||
val showDialog: Boolean = false,
|
||||
val showingBackWarningDialogText: Int? = null,
|
||||
val clearData: Boolean = false
|
||||
) {
|
||||
val pushDisabled get() = !pushEnabled
|
||||
|
Loading…
Reference in New Issue
Block a user