Remove code duplication

This commit is contained in:
Maurice Parker 2020-10-30 11:21:49 -05:00
parent c1c8b97b08
commit 81ae58e061

View File

@ -225,11 +225,7 @@ private extension AccountsPreferencesViewController {
} }
func showController(_ controller: NSViewController) { func showController(_ controller: NSViewController) {
hideController()
if let controller = children.first {
children.removeAll()
controller.view.removeFromSuperview()
}
addChild(controller) addChild(controller)
controller.view.translatesAutoresizingMaskIntoConstraints = false controller.view.translatesAutoresizingMaskIntoConstraints = false