Show discard or keep alert after tapping outside of the PR reviewers,…#2633
Show discard or keep alert after tapping outside of the PR reviewers,…#2633julienbodet wants to merge 2 commits intoGitHawkApp:masterfrom
Conversation
… assignees, milestones, labels modal
| let selected = controller.selected | ||
| guard controller.selectionChanged(newValues: selected) else { return } | ||
|
|
||
| if controller.wasDismissedByDone { |
There was a problem hiding this comment.
Can we put this logic in a function, as it seems to be repeated from lines 312-320?
| private var owner: String | ||
| private var repo: String | ||
|
|
||
| var wasDismissedByDone: Bool = false |
There was a problem hiding this comment.
Should this variable be included in the delegate maybe? What do you think?
There was a problem hiding this comment.
Are you talking about ContextMenuDelegate? Maybe we can modify its functions signatures to add this flag:
public protocol ContextMenuDelegate: class {
func contextMenuWillDismiss(viewController: UIViewController, animated: Bool, doneTapped: Bool)
func contextMenuDidDismiss(viewController: UIViewController, animated: Bool, doneTapped: Bool)
}There was a problem hiding this comment.
Yes, that sounds good! Would maybe make it didTapDone (or maybe even viaButton: Button or similar, do be able to differentiate?)
A bit tricky as the ContextMenu is a separate pod and will probably not always contain a Done.
|
@julienbodet still on this? Sent with GitHawk |
@Huddie yep still on it. I addressed most of comments but I didn’t push yet. Sent with GitHawk |
… assignees, milestones, labels modal
This my first contribution to GitHawk :) Thanks for the awesome project!
I implemented the feature from #2582. Now after tapping outside the modal for PR reviewers, assignees, milestone or labels, an alert appears asking to keep or discard the changes, if any.