animation on onboarding

This commit is contained in:
Avently
2024-11-22 14:47:51 +07:00
parent 4f71e8c252
commit 300bf3eac6
2 changed files with 18 additions and 4 deletions
@@ -274,12 +274,20 @@ private fun AcceptConditionsButton(
val r2 = chatController.setServerOperators(rh = chatModel.remoteHostId(), operators = enabledOperators)
if (r2 != null) {
chatModel.conditions.value = r2
if (onboarding) { close() }
continueToNextStep(onboarding, close)
if (appPlatform.isDesktop || !onboarding) {
if (onboarding) { close() }
continueToNextStep(onboarding, close)
} else {
continueToSetNotificationsAfterAccept()
}
}
} else {
if (onboarding) { close() }
continueToNextStep(onboarding, close)
if (appPlatform.isDesktop || !onboarding) {
if (onboarding) { close() }
continueToNextStep(onboarding, close)
} else {
continueToSetNotificationsAfterAccept()
}
}
}
}
@@ -295,6 +303,11 @@ private fun continueToNextStep(onboarding: Boolean, close: () -> Unit) {
}
}
private fun continueToSetNotificationsAfterAccept() {
appPrefs.onboardingStage.set(OnboardingStage.Step4_SetNotificationsMode)
ModalManager.fullscreen.showModalCloseable(showClose = false) { SetNotificationsMode(chatModel) }
}
private fun enabledOperators(operators: List<ServerOperator>, selectedOperatorIds: Set<Long>): List<ServerOperator>? {
val ops = ArrayList(operators)
if (ops.isNotEmpty()) {
@@ -57,6 +57,7 @@ fun SetNotificationsMode(m: ChatModel) {
onboarding = OnboardingStage.OnboardingComplete,
onclick = {
changeNotificationsMode(currentMode.value, m)
ModalManager.fullscreen.closeModals()
}
)
// Reserve space