This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Fix UI while a share is being added#417
Merged
Merged
Conversation
After calling "Gallery.Share.share" the UI was restored (the working icon was hidden, the input field enabled...). However, "share" is asynchronous, so the UI was restored while the share was still being added. Now the UI is restored in the share callbacks, so it is restored once the sharing finished, either successfully or with a failure; in this later case now a notification is also shown. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #417 +/- ##
=========================================
Coverage 82.55% 82.55%
Complexity 360 360
=========================================
Files 38 38
Lines 1313 1313
=========================================
Hits 1084 1084
Misses 229 229Continue to review full report at Codecov.
|
Member
Let's do it ... stable13 should also fix the paper cuts ;) |
Member
But only if it applies without problems ;) |
Member
Author
Done; and although I have not checked it, it probably applies without problems on stable12 too if needed ;-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After calling
Gallery.Share.sharethe UI was restored (the working icon was hidden, the input field enabled...). However,shareis asynchronous, so the UI was restored while the share was still beingadded. Now the UI is restored in the share callbacks, so it is restored once the sharing finished, either successfully or with a failure; in this later case now a notification is also shown.
Probably not worth a backport, although it should be straightforward to do it.
How to test
sleep(10);to the beginning of thecreatemethod to simulate a slow serverExpected result
The input field is disabled and the working icon is shown until the share is finally added.
Actual result
The input field is enabled and the working icon is hidden immediately.