From cd0b3f567b2cd9c6bf6bf6481c72c696b3664420 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Sun, 8 May 2022 14:37:12 +0100 Subject: [PATCH] using single instance of the clock to avoid recomposition lookups --- .../kotlin/app/dapk/st/directory/DirectoryListingScreen.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryListingScreen.kt b/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryListingScreen.kt index 46e69dd..5042a4e 100644 --- a/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryListingScreen.kt +++ b/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryListingScreen.kt @@ -115,13 +115,15 @@ private fun DirectoryViewModel.ObserveEvents(listState: LazyListState, toolbarPo } } + +val clock = Clock.systemUTC() + @Composable private fun Content(listState: LazyListState, state: Content) { val context = LocalContext.current val navigateToRoom = { roomId: RoomId -> context.startActivity(MessengerActivity.newInstance(context, roomId)) } - val clock = Clock.systemUTC() val scope = rememberCoroutineScope() LaunchedEffect(key1 = state.overviewState) {