Skip to content

Commit

Permalink
Fix sd card not mounted display (#858)
Browse files Browse the repository at this point in the history
**Background**

On Hub->Installed sd card error displayed even if it's loaded. This
happens because of long `cacheLoader.loadCache` operation

**Changes**

- Added initial state before `cacheLoader.loadCache` operation

**Test plan**

- Open Hub->Installed
- See SD Card error now does not display as long as before
- Additionaly add more logs ore debug breakpoint into
`FapManifestsLoader` to see `NoSdCardException` message
  • Loading branch information
makeevrserg authored May 15, 2024
1 parent 4db8243 commit 81a0aaa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- [FIX] Fix TopBar above system bar in file manager file edit screen
- [FIX] Fix custom version detection
- [FIX] Text overflow on apps card
- [FIX] SD Card error on installed screen
- [Feature] Add not connected, empty and syncing states to emulation button on key screen
- [Feature] Check app exist on apps catalog manifest loading
- [Feature] First version of device orchestrator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class FapManifestsLoader @AssistedInject constructor(

fun getManifestLoaderState() = manifestLoaderState.asStateFlow()

@Suppress("LongMethod")
private suspend fun loadInternal(
connectionState: ConnectionState,
storageInformation: FlipperStorageInformation
Expand All @@ -118,6 +119,12 @@ class FapManifestsLoader @AssistedInject constructor(
if (externalStorageStatus == null || externalStorageStatus.data !is StorageStats.Loaded) {
throw NoSdCardException()
}
manifestLoaderState.emit(
FapManifestLoaderState.Loaded(
items = persistentListOf(),
isLoading = true
)
)
info { "Start load manifests" }
val cacheResult = cacheLoader.loadCache()
info { "Cache load result is toLoad: ${cacheResult.toLoadNames}, cached: ${cacheResult.cachedNames}" }
Expand Down

0 comments on commit 81a0aaa

Please sign in to comment.