From 99b2d3bb0152a058c0dd3e264bf8d83b875edb55 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 15 Jul 2020 09:14:04 +0800 Subject: [PATCH] removes dead code & correctly dismisses sheets --- .../Accounts/Account Preferences/AccountsPreferencesModel.swift | 1 - .../Account Preferences/Add Account/AddAccountView.swift | 1 + .../Edit Account/EditAccountCredentialsView.swift | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/AccountsPreferencesModel.swift b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/AccountsPreferencesModel.swift index 904f2de29..2a9b58240 100644 --- a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/AccountsPreferencesModel.swift +++ b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/AccountsPreferencesModel.swift @@ -52,7 +52,6 @@ class AccountsPreferencesModel: ObservableObject { account?.name = accountName } } - @Published var showAddCredentialsView: Bool = false // Sheets @Published var showSheet: Bool = false diff --git a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/AddAccountView.swift b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/AddAccountView.swift index aa231c3a8..0d9320e4b 100644 --- a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/AddAccountView.swift +++ b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/AddAccountView.swift @@ -95,6 +95,7 @@ struct AddAccountView: View { .onChange(of: viewModel.accountAdded) { value in if value == true { preferencesModel.showAddAccountView = false + presentationMode.wrappedValue.dismiss() } } .alert(isPresented: $viewModel.showError) { diff --git a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Edit Account/EditAccountCredentialsView.swift b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Edit Account/EditAccountCredentialsView.swift index 8d2054960..4e7ee9710 100644 --- a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Edit Account/EditAccountCredentialsView.swift +++ b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Edit Account/EditAccountCredentialsView.swift @@ -70,6 +70,7 @@ struct EditAccountCredentialsView: View { .onChange(of: editModel.accountCredentialsWereUpdated) { value in if value == true { viewModel.sheetToShow = .none + presentationMode.wrappedValue.dismiss() } } .alert(isPresented: $editModel.showError) {