You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccount/SavingsAccountViewmodel.kt
+51-9Lines changed: 51 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,15 @@ class SavingsAccountViewmodel(
66
66
}
67
67
}
68
68
69
-
/** Handles changes in network connectivity. */
69
+
/**
70
+
* Handles changes in network connectivity.
71
+
*
72
+
* It updates the `networkStatus` state. If the network is offline, it sets the
73
+
* `uiState` to [ScreenUiState.Network]. If the network is online, it
74
+
* automatically triggers a data fetch to refresh the content.
75
+
*
76
+
* @param isOnline A boolean indicating the current network status.
77
+
*/
70
78
privatefunhandleNetworkStatus(isOnline:Boolean) {
71
79
updateState { it.copy(networkStatus = isOnline) }
72
80
@@ -89,7 +97,11 @@ class SavingsAccountViewmodel(
89
97
}
90
98
}
91
99
92
-
/** A helper function to update the mutable state flow. */
100
+
/**
101
+
* A helper function to update the mutable state flow.
102
+
*
103
+
* @param update A lambda function that takes the current state and returns a new state.
0 commit comments