-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix file upload progress #985
Fix file upload progress #985
Conversation
@@ -55,10 +57,21 @@ class FilesDecomposeComponentImpl @AssistedInject constructor( | |||
childFactory = { bottomSheetFile, _ -> bottomSheetFile } | |||
) | |||
|
|||
private val selectionViewModel = instanceKeeper.getOrCreate(path.toString()) { | |||
private val selectionViewModel = instanceKeeper.getOrCreate("selectionViewModel_$path") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's necessary? As far as I remember the viewmodel class name is already used for the unique key. Can you explain why it is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filesViewModel
and selectionViewModel
previously were using same key "$path" before it crashed. The crash was becaseu intanceKeeper got class by key "$path" and the class was filesViewModel
. But should be selectionViewModel
. So the instance keeper compare only key, not class itself. Due to this implementation classes with "same key" needs to add unique prefix.
The reason why this is required inside InstanceKeeper impl:
check(key !in map) { "Another instance is already associated with the key: $key" }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the instance keeper compare only key, not class itself.
That's weird, I've been re-doing that part - let's discuss in a PM after your vacation
CHANGELOG.md
Outdated
@@ -70,6 +70,7 @@ Attention: don't forget to add the flag for F-Droid before release | |||
- [FIX] Add deeplink fallback for flipper scheme uri | |||
- [FIX] Change description of remotes library card | |||
- [FIX] Fix bytes race in new api | |||
- [FIX] New file manager uploading progress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please, change changelog
Background
This PR aims to improve new file manager uploading reactivity and fix ui for multiple files
Changes
Test plan