File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/src/main/kotlin/com/darkrockstudios/app/securecamera/viewphoto Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -39,14 +39,20 @@ class ViewPhotoViewModel(
3939 val initialIndex = mediaItems.indexOfFirst { it.mediaName == initialMediaName }
4040 val initialMedia = mediaItems.getOrNull(initialIndex)
4141
42+ // Set mediaItems and currentIndex so they're available immediately
43+ _uiState .update {
44+ it.copy(
45+ mediaItems = mediaItems,
46+ currentIndex = if (initialIndex >= 0 ) initialIndex else 0 ,
47+ )
48+ }
49+
4250 viewModelScope.launch {
4351 val hasPoisonPill = pinRepository.hasPoisonPillPin()
4452 val isDecoy = (initialMedia as ? PhotoDef )?.let { imageManager.isDecoyPhoto(it) } ? : false
4553
4654 _uiState .update {
4755 it.copy(
48- mediaItems = mediaItems,
49- currentIndex = if (initialIndex >= 0 ) initialIndex else 0 ,
5056 hasPoisonPill = hasPoisonPill,
5157 isDecoy = isDecoy
5258 )
You can’t perform that action at this time.
0 commit comments