-
Notifications
You must be signed in to change notification settings - Fork 437
[NEW] Add the actions to the Subscription (Hide, Leave, Mark as Read & Unread) #1960
[NEW] Add the actions to the Subscription (Hide, Leave, Mark as Read & Unread) #1960
Conversation
…_subscriptions.1518 [FIX] Theming on swipe actions
…equest and generating inconsistency
|
@Sameesunkaria just experienced the The |
| reloadNotificationToken = realm?.objects(Auth.self).observe({ [weak self] _ in | ||
| if self?.realm?.objects(Auth.self).count == 1 { | ||
| DispatchQueue.main.async { | ||
| self?.reloadData?() |
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.
@Sameesunkaria this is to make sure we will have the Auth object accessible when first loading the SubscriptionsViewController?
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.
This is to reload the cells so that the avatar views get updated when the server url is accessible. This is required after the first login. If you have a better solution, please let me know.
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.
The solutions looks good, I was just thinking that we could invalidate the token after executing the block once. It seems that it only needs to be executed once. Does it makes sense?
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.
It gets called a few times, so if we invalidate it before that (after the first time the block executes) it sometimes causes the images to not be loaded. I am not sure as to why it gets called more than once. If you can figure that out, maybe we'll be able to invalidate that notification.
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.
Got it. Let's leave it this way, it's not critical, we can improve in another PR. Thanks for explaining
|
Found one more bug related to section header layout Sent with GitHawk |
…metimes we were not being able to get the correct center y in runtime
| <constraint firstItem="gd8-ny-3Np" firstAttribute="trailing" secondItem="SwS-x7-2jR" secondAttribute="trailing" id="MYk-K7-viX"/> | ||
| <constraint firstItem="SwS-x7-2jR" firstAttribute="trailing" secondItem="gOj-Q6-yQs" secondAttribute="trailing" constant="16" id="S8t-kq-5ZF"/> | ||
| <constraint firstItem="gOj-Q6-yQs" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="ZmT-uy-R4W"/> | ||
| <constraint firstItem="gOj-Q6-yQs" firstAttribute="top" secondItem="SwS-x7-2jR" secondAttribute="top" constant="13.5" id="zGn-Dp-2U7"/> |
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.
Haha, was just about to push the same change...
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.
Haha, cool! 🤓
filipealva
left a comment
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.
Everything working fine! Thank you guys for this PR, specially @Sameesunkaria 💯
cardoso
left a comment
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.
Great work overall, just a few considerations.
Only change I think is critical right now is to move the new Subscription methods to struct SubscriptionsClient
|
|
||
| extension Subscription { | ||
| func favoriteSubscription() { | ||
| SubscriptionManager.toggleFavorite(self) { (response) in |
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.
These functions should be in struct SubscriptionsClient so we can use other APIs than API.current() and also be able to test with MockAPI.
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.
@cardoso Made some changes...
| "subscriptions.list.actions.unread" = "Não lido"; | ||
| "subscriptions.list.actions.favorite" = "Favorite"; // TODO | ||
| "subscriptions.list.actions.unfavorite" = "Unfavorite"; // TODO | ||
| "subscriptions.list.actions.hide" = "Fechar"; |
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.
"Esconder"? 🤔
| "subscriptions.list.actions.read" = "Lido"; | ||
| "subscriptions.list.actions.unread" = "Não lido"; | ||
| "subscriptions.list.actions.favorite" = "Favorite"; // TODO | ||
| "subscriptions.list.actions.unfavorite" = "Unfavorite"; // TODO |
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.
"Remover dos Favoritos"
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.
This text is shown under the swipe actions. something shorter would be preferred.
| "subscriptions.list.date.yesterday" = "Ontem"; | ||
| "subscriptions.list.actions.read" = "Lido"; | ||
| "subscriptions.list.actions.unread" = "Não lido"; | ||
| "subscriptions.list.actions.favorite" = "Favorite"; // TODO |
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.
"Adic. aos Favoritos"
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.
"Adicionar aos Favoritos"? @rafaelks 🤔
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.
👍
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.
This text is shown under the swipe actions. something shorter would be preferred.
|
Great work here @Sameesunkaria and @filipealva! Is this one ready to be merged? |

@RocketChat/ios
What's new in this PR
Note: The implementation of swipe actions provided in
UIKithas several bugs, and in its current state does not work well with our use case. SwipeCellKit also has some issues, working with DifferenceKit, but the simple workaround is that we don't use the .destructive style.Closes #1518
Closes #2131