@@ -43,9 +43,7 @@ import androidx.compose.runtime.Composable
4343import androidx.compose.runtime.LaunchedEffect
4444import androidx.compose.runtime.collectAsState
4545import androidx.compose.runtime.getValue
46- import androidx.compose.runtime.mutableStateOf
4746import androidx.compose.runtime.remember
48- import androidx.compose.runtime.setValue
4947import androidx.compose.ui.Alignment
5048import androidx.compose.ui.Modifier
5149import androidx.compose.ui.graphics.vector.ImageVector
@@ -54,7 +52,6 @@ import androidx.compose.ui.text.font.FontWeight
5452import androidx.compose.ui.text.style.TextAlign
5553import androidx.compose.ui.unit.dp
5654import androidx.hilt.navigation.compose.hiltViewModel
57- import org.json.JSONObject
5855import to.bitkit.paykit.services.PubkyRingBridge
5956import to.bitkit.paykit.viewmodels.DashboardViewModel
6057import to.bitkit.ui.components.Title
@@ -77,38 +74,7 @@ fun PaykitDashboardScreen(
7774 onNavigateToPubkyRingAuth : () -> Unit = {},
7875 viewModel : DashboardViewModel = hiltViewModel(),
7976) {
80- // #region agent log
81- try {
82- val logData = mapOf (
83- " location" to " PaykitDashboardScreen.kt:79" ,
84- " message" to " PaykitDashboardScreen composable entry" ,
85- " data" to mapOf (" hasViewModel" to (viewModel != null )),
86- " timestamp" to System .currentTimeMillis(),
87- " sessionId" to " debug-session" ,
88- " runId" to " run1" ,
89- " hypothesisId" to " A"
90- )
91- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
92- } catch (e: Exception ) {}
93- // #endregion
94-
9577 val context = LocalContext .current
96-
97- // #region agent log
98- try {
99- val logData = mapOf (
100- " location" to " PaykitDashboardScreen.kt:82" ,
101- " message" to " Before collectAsState calls" ,
102- " data" to mapOf (" contextNotNull" to (context != null )),
103- " timestamp" to System .currentTimeMillis(),
104- " sessionId" to " debug-session" ,
105- " runId" to " run1" ,
106- " hypothesisId" to " B"
107- )
108- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
109- } catch (e: Exception ) {}
110- // #endregion
111-
11278 val recentReceipts by viewModel.recentReceipts.collectAsState()
11379 val contactCount by viewModel.contactCount.collectAsState()
11480 val totalSent by viewModel.totalSent.collectAsState()
@@ -120,126 +86,16 @@ fun PaykitDashboardScreen(
12086 val pendingRequests by viewModel.pendingRequests.collectAsState()
12187 val publishedMethodsCount by viewModel.publishedMethodsCount.collectAsState()
12288
123- // #region agent log
124- try {
125- val logData = mapOf (
126- " location" to " PaykitDashboardScreen.kt:95" ,
127- " message" to " Before PubkyRingBridge.getInstance()" ,
128- " data" to emptyMap<String , Any >(),
129- " timestamp" to System .currentTimeMillis(),
130- " sessionId" to " debug-session" ,
131- " runId" to " run1" ,
132- " hypothesisId" to " A"
133- )
134- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
135- } catch (e: Exception ) {}
136- // #endregion
137-
13889 val pubkyRingBridge = remember {
139- try {
140- PubkyRingBridge .getInstance()
141- } catch (e: Exception ) {
142- // #region agent log
143- try {
144- val logData = mapOf (
145- " location" to " PaykitDashboardScreen.kt:98" ,
146- " message" to " PubkyRingBridge.getInstance() failed" ,
147- " data" to mapOf (" error" to (e.message ? : " unknown" ), " errorType" to e.javaClass.simpleName),
148- " timestamp" to System .currentTimeMillis(),
149- " sessionId" to " debug-session" ,
150- " runId" to " run1" ,
151- " hypothesisId" to " A"
152- )
153- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
154- } catch (logErr: Exception ) {}
155- // #endregion
156- null
157- }
90+ runCatching { PubkyRingBridge .getInstance() }.getOrNull()
15891 }
15992
160- // #region agent log
161- try {
162- val logData = mapOf (
163- " location" to " PaykitDashboardScreen.kt:105" ,
164- " message" to " After PubkyRingBridge.getInstance()" ,
165- " data" to mapOf (" pubkyRingBridgeNotNull" to (pubkyRingBridge != null )),
166- " timestamp" to System .currentTimeMillis(),
167- " sessionId" to " debug-session" ,
168- " runId" to " run1" ,
169- " hypothesisId" to " A"
170- )
171- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
172- } catch (e: Exception ) {}
173- // #endregion
174-
17593 val isPubkyRingInstalled = remember(pubkyRingBridge) {
176- // #region agent log
177- try {
178- val logData = mapOf (
179- " location" to " PaykitDashboardScreen.kt:115" ,
180- " message" to " Calling isPubkyRingInstalled" ,
181- " data" to mapOf (" pubkyRingBridgeNotNull" to (pubkyRingBridge != null ), " contextNotNull" to (context != null )),
182- " timestamp" to System .currentTimeMillis(),
183- " sessionId" to " debug-session" ,
184- " runId" to " run1" ,
185- " hypothesisId" to " A"
186- )
187- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
188- } catch (e: Exception ) {}
189- // #endregion
19094 pubkyRingBridge?.isPubkyRingInstalled(context) ? : false
19195 }
19296
19397 LaunchedEffect (Unit ) {
194- // #region agent log
195- try {
196- val logData = mapOf (
197- " location" to " PaykitDashboardScreen.kt:192" ,
198- " message" to " LaunchedEffect triggered, calling loadDashboard" ,
199- " data" to emptyMap<String , Any >(),
200- " timestamp" to System .currentTimeMillis(),
201- " sessionId" to " debug-session" ,
202- " runId" to " run1" ,
203- " hypothesisId" to " B"
204- )
205- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
206- } catch (e: Exception ) {}
207- // #endregion
208-
209- try {
210- viewModel.loadDashboard()
211-
212- // #region agent log
213- try {
214- val logData = mapOf (
215- " location" to " PaykitDashboardScreen.kt:205" ,
216- " message" to " loadDashboard call completed" ,
217- " data" to emptyMap<String , Any >(),
218- " timestamp" to System .currentTimeMillis(),
219- " sessionId" to " debug-session" ,
220- " runId" to " run1" ,
221- " hypothesisId" to " B"
222- )
223- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
224- } catch (e: Exception ) {}
225- // #endregion
226- } catch (e: Exception ) {
227- // #region agent log
228- try {
229- val logData = mapOf (
230- " location" to " PaykitDashboardScreen.kt:217" ,
231- " message" to " loadDashboard threw exception" ,
232- " data" to mapOf (" error" to (e.message ? : " unknown" ), " errorType" to e.javaClass.simpleName, " stackTrace" to e.stackTraceToString()),
233- " timestamp" to System .currentTimeMillis(),
234- " sessionId" to " debug-session" ,
235- " runId" to " run1" ,
236- " hypothesisId" to " B"
237- )
238- java.io.File (" /Users/john/Library/Mobile Documents/com~apple~CloudDocs/vibes/pubky-ring/.cursor/debug.log" ).appendText(org.json.JSONObject (logData).toString() + " \n " )
239- } catch (logErr: Exception ) {}
240- // #endregion
241- throw e
242- }
98+ viewModel.loadDashboard()
24399 }
244100
245101 ScreenColumn {
0 commit comments