Skip to content

Conversation

@dzign1
Copy link
Contributor

@dzign1 dzign1 commented Apr 12, 2022

Description

Welcome screen now disappears when the 'Open a file or folder' is pressed. This is done by adding a cancel handler parameter to the openDocument function which calls the openWelcome function once cancel is pressed.

Related Issue

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • I documented my code
  • Review requested

Screenshots

@dzign1 dzign1 closed this Apr 12, 2022
@dzign1 dzign1 reopened this Apr 12, 2022
} else {
CodeEditDocumentController.shared.openDocument { _, _ in
}
else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the else statement to the previous line:

if ... { 
  ...
} else {
  
}

having it on a new line fails in SwiftLint


extension NSDocumentController {
func openDocument(completionHandler: @escaping (NSDocument?, Bool) -> Void) {
func openDocument(completionHandler: @escaping (NSDocument?, Bool) -> Void, cancelHandler: @escaping () -> Void) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of

func openDocument(completionHandler: @escaping (NSDocument?, Bool) -> Void, cancelHandler: @escaping () -> Void) {}

consider using a blank or onCompletion label for the first argument and onCancel for the second one.

func openDocument(_ completionHandler: @escaping (NSDocument?, Bool) -> Void, onCancel: @escaping () -> Void) {}

@lukepistrol lukepistrol added the enhancement New feature or request label Apr 12, 2022
@lukepistrol lukepistrol merged commit a807500 into CodeEditApp:main Apr 12, 2022
@dzign1
Copy link
Contributor Author

dzign1 commented Apr 13, 2022

Many thanks 👍 @lukepistrol

@austincondiff
Copy link
Collaborator

@all-contributors please add @dzign1 for code

@allcontributors
Copy link
Contributor

@austincondiff

I've put up a pull request to add @dzign1! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants