1
1
package com.getcode.navigation.screens
2
2
3
3
import androidx.compose.runtime.Composable
4
- import androidx.compose.runtime.LaunchedEffect
5
4
import androidx.compose.ui.platform.LocalLifecycleOwner
6
5
import androidx.compose.ui.res.stringResource
7
6
import cafe.adriel.voyager.core.screen.ScreenKey
@@ -32,15 +31,8 @@ import com.getcode.view.main.getKin.GetKinSheetViewModel
32
31
import com.getcode.view.main.getKin.ReferFriend
33
32
import com.getcode.view.main.tip.EnterTipScreen
34
33
import com.getcode.view.main.tip.RequestTipScreen
35
- import kotlinx.coroutines.delay
36
- import kotlinx.coroutines.flow.delayFlow
37
- import kotlinx.coroutines.flow.filterIsInstance
38
- import kotlinx.coroutines.flow.launchIn
39
- import kotlinx.coroutines.flow.onEach
40
- import kotlinx.coroutines.flow.onStart
41
34
import kotlinx.parcelize.IgnoredOnParcel
42
35
import kotlinx.parcelize.Parcelize
43
- import timber.log.Timber
44
36
45
37
46
38
@Parcelize
@@ -53,7 +45,7 @@ data object DepositKinScreen : MainGraph, ModalContent {
53
45
54
46
@Composable
55
47
override fun Content () {
56
- ModalContainer (backButton = { it is DepositKinScreen }) {
48
+ ModalContainer (backButtonEnabled = { it is DepositKinScreen }) {
57
49
AccountDeposit ()
58
50
}
59
51
@@ -74,7 +66,7 @@ data object FaqScreen : MainGraph, ModalContent {
74
66
75
67
@Composable
76
68
override fun Content () {
77
- ModalContainer (backButton = { it is FaqScreen }) {
69
+ ModalContainer (backButtonEnabled = { it is FaqScreen }) {
78
70
AccountFaq (getViewModel())
79
71
}
80
72
@@ -95,7 +87,7 @@ data object AccountDebugOptionsScreen : MainGraph, ModalContent {
95
87
96
88
@Composable
97
89
override fun Content () {
98
- ModalContainer (backButton = { it is AccountDebugOptionsScreen }) {
90
+ ModalContainer (backButtonEnabled = { it is AccountDebugOptionsScreen }) {
99
91
BetaFlagsScreen (getViewModel())
100
92
}
101
93
@@ -116,7 +108,7 @@ data object AccountDetailsScreen : MainGraph, ModalContent {
116
108
117
109
@Composable
118
110
override fun Content () {
119
- ModalContainer (backButton = { it is AccountDetailsScreen }) {
111
+ ModalContainer (backButtonEnabled = { it is AccountDetailsScreen }) {
120
112
AccountDetails (getActivityScopedViewModel())
121
113
}
122
114
}
@@ -132,7 +124,7 @@ data object BackupScreen : MainGraph, ModalContent {
132
124
133
125
@Composable
134
126
override fun Content () {
135
- ModalContainer (backButton = { it is BackupScreen }) {
127
+ ModalContainer (backButtonEnabled = { it is BackupScreen }) {
136
128
BackupKey (getViewModel())
137
129
}
138
130
@@ -154,7 +146,7 @@ data object PhoneNumberScreen : MainGraph, ModalContent {
154
146
155
147
@Composable
156
148
override fun Content () {
157
- ModalContainer (backButton = { it is PhoneNumberScreen }) {
149
+ ModalContainer (backButtonEnabled = { it is PhoneNumberScreen }) {
158
150
AccountPhone (getViewModel())
159
151
}
160
152
}
@@ -181,7 +173,7 @@ data class PhoneVerificationScreen(
181
173
override fun Content () {
182
174
val navigator = LocalCodeNavigator .current
183
175
val viewModel = getStackScopedViewModel<PhoneVerifyViewModel >(key)
184
- ModalContainer (backButton = { it is PhoneVerificationScreen }) {
176
+ ModalContainer (backButtonEnabled = { it is PhoneVerificationScreen }) {
185
177
PhoneVerify (viewModel, arguments) {
186
178
navigator.show(PhoneAreaSelectionModal (key))
187
179
}
@@ -202,7 +194,7 @@ data class PhoneAreaSelectionModal(val providedKey: String) : MainGraph, ModalCo
202
194
val navigator = LocalCodeNavigator .current
203
195
val vm = getStackScopedViewModel<PhoneVerifyViewModel >(providedKey)
204
196
205
- ModalContainer (closeButton = { it is PhoneAreaSelectionModal }) {
197
+ ModalContainer (closeButtonEnabled = { it is PhoneAreaSelectionModal }) {
206
198
PhoneCountrySelection (viewModel = vm) {
207
199
navigator.hide()
208
200
}
@@ -229,7 +221,7 @@ data class PhoneConfirmationScreen(
229
221
230
222
@Composable
231
223
override fun Content () {
232
- ModalContainer (backButton = { it is PhoneConfirmationScreen }) {
224
+ ModalContainer (backButtonEnabled = { it is PhoneConfirmationScreen }) {
233
225
PhoneConfirm (
234
226
getViewModel(),
235
227
arguments = arguments,
@@ -249,7 +241,7 @@ data object DeleteCodeScreen : MainGraph, ModalContent {
249
241
250
242
@Composable
251
243
override fun Content () {
252
- ModalContainer (backButton = { it is DeleteCodeScreen }) {
244
+ ModalContainer (backButtonEnabled = { it is DeleteCodeScreen }) {
253
245
DeleteCodeAccount ()
254
246
}
255
247
}
@@ -265,7 +257,7 @@ data object DeleteConfirmationScreen : MainGraph, ModalContent {
265
257
266
258
@Composable
267
259
override fun Content () {
268
- ModalContainer (backButton = { it is DeleteConfirmationScreen }) {
260
+ ModalContainer (backButtonEnabled = { it is DeleteConfirmationScreen }) {
269
261
ConfirmDeleteAccount (getViewModel())
270
262
}
271
263
}
@@ -278,7 +270,7 @@ data object ReferFriendScreen : MainGraph, ModalContent {
278
270
279
271
@Composable
280
272
override fun Content () {
281
- ModalContainer (backButton = { it is DeleteConfirmationScreen }) {
273
+ ModalContainer (backButtonEnabled = { it is DeleteConfirmationScreen }) {
282
274
ReferFriend ()
283
275
}
284
276
}
@@ -297,7 +289,7 @@ data object CurrencySelectionModal : MainGraph, ModalContent {
297
289
override fun Content () {
298
290
val navigator = LocalCodeNavigator .current
299
291
ModalContainer (
300
- backButton = {
292
+ backButtonEnabled = {
301
293
if (navigator.isVisible) {
302
294
it is CurrencySelectionModal
303
295
} else {
@@ -339,7 +331,7 @@ data class BuyMoreKinModal(
339
331
340
332
if (showClose) {
341
333
ModalContainer (
342
- closeButton = {
334
+ closeButtonEnabled = {
343
335
if (navigator.isVisible) {
344
336
it is BuyMoreKinModal
345
337
} else {
@@ -351,7 +343,7 @@ data class BuyMoreKinModal(
351
343
}
352
344
} else {
353
345
ModalContainer (
354
- backButton = {
346
+ backButtonEnabled = {
355
347
if (navigator.isVisible) {
356
348
it is BuyMoreKinModal
357
349
} else {
@@ -387,7 +379,7 @@ data class EnterTipModal(val isInChat: Boolean = false) : MainGraph, ModalRoot {
387
379
val navigator = LocalCodeNavigator .current
388
380
if (isInChat) {
389
381
ModalContainer (
390
- backButton = {
382
+ backButtonEnabled = {
391
383
if (navigator.isVisible) {
392
384
it is EnterTipModal
393
385
} else {
@@ -401,7 +393,7 @@ data class EnterTipModal(val isInChat: Boolean = false) : MainGraph, ModalRoot {
401
393
}
402
394
} else {
403
395
ModalContainer (
404
- closeButton = {
396
+ closeButtonEnabled = {
405
397
if (navigator.isVisible) {
406
398
it is EnterTipModal
407
399
} else {
@@ -427,7 +419,7 @@ data object RequestTip : MainGraph, ModalContent {
427
419
override fun Content () {
428
420
val navigator = LocalCodeNavigator .current
429
421
ModalContainer (
430
- backButton = {
422
+ backButtonEnabled = {
431
423
if (navigator.isVisible) {
432
424
it is RequestTip
433
425
} else {
@@ -451,7 +443,7 @@ data object GetKinModal : MainGraph, ModalRoot {
451
443
452
444
val viewModel = getViewModel<GetKinSheetViewModel >()
453
445
ModalContainer (
454
- closeButton = {
446
+ closeButtonEnabled = {
455
447
if (navigator.isVisible) {
456
448
it is GetKinModal
457
449
} else {
@@ -476,7 +468,7 @@ data object BuySellScreen : MainGraph, ModalContent {
476
468
477
469
@Composable
478
470
override fun Content () {
479
- ModalContainer (backButton = { it is BuySellScreen }) {
471
+ ModalContainer (backButtonEnabled = { it is BuySellScreen }) {
480
472
BuyAndSellKin (getViewModel())
481
473
}
482
474
0 commit comments