File tree Expand file tree Collapse file tree
apps/flipcash/shared/session/src/main/kotlin/com/flipcash/app/session/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ class RealSessionController @Inject constructor(
175175 toastController.show(
176176 amount = amount,
177177 isDeposit = true ,
178- initialDelay = 1 .seconds
178+ initialDelay = AIRDROP_INITIAL_DELAY
179179 )
180180 }
181181 }
@@ -330,7 +330,7 @@ class RealSessionController @Inject constructor(
330330 shareSheetController.reset(setChecked = true )
331331
332332 // delay _slightly_ before presenting confirmation
333- delay(2.5 .seconds )
333+ delay(CASH_LINK_CONFIRMATION_DELAY )
334334
335335 // confirm the result of the share
336336 val confirmResult = shareConfirmationController.confirm(shareable, result)
@@ -591,12 +591,15 @@ class RealSessionController @Inject constructor(
591591 billController.reset(showToast = shown)
592592
593593 if (shown) {
594- delay(5 .seconds )
594+ delay(ToastController . SHOW_DELAY )
595595 }
596596 if (! overrideToast) {
597597 shareSheetController.reset()
598598 }
599599 billController.reset()
600600 }
601601 }
602- }
602+ }
603+
604+ private val AIRDROP_INITIAL_DELAY = 1 .seconds
605+ private val CASH_LINK_CONFIRMATION_DELAY = 1 .seconds
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ import kotlin.time.Duration.Companion.seconds
1919class ToastController @Inject constructor(
2020 private val billController : BillController
2121) {
22+ companion object {
23+ val INITIAL_DELAY = 500 .milliseconds
24+ val SHOW_DELAY = 5 .seconds
25+ }
2226 private val scope = CoroutineScope (Dispatchers .IO + SupervisorJob ())
2327
2428 fun showIfNeeded (
@@ -49,7 +53,7 @@ class ToastController @Inject constructor(
4953 fun show (
5054 amount : LocalFiat ,
5155 isDeposit : Boolean = false,
52- initialDelay : Duration = 500.milliseconds
56+ initialDelay : Duration = INITIAL_DELAY
5357 ) {
5458 if (amount.converted.doubleValue == 0.0 ) {
5559 return
@@ -64,7 +68,7 @@ class ToastController @Inject constructor(
6468 )
6569 }
6670
67- delay(5 .seconds )
71+ delay(SHOW_DELAY )
6872
6973 billController.update {
7074 it.copy(
@@ -73,11 +77,10 @@ class ToastController @Inject constructor(
7377 }
7478
7579 // wait for animation to run
76- delay(500 .milliseconds )
80+ delay(INITIAL_DELAY )
7781 billController.update {
7882 it.copy(toast = null )
7983 }
8084 }
81-
8285 }
8386}
You can’t perform that action at this time.
0 commit comments