From f1db2f716d0ff1e6657bf763a28d8df9530dfdc8 Mon Sep 17 00:00:00 2001 From: Yusuke Arakawa <108506642+nekolaboratory@users.noreply.github.com> Date: Sun, 26 Feb 2023 02:28:27 +0900 Subject: [PATCH] Adjusted how to hide the voting screen (#1054) Like other submission item selection screens, the voting screen can now be shown/hidden with a button toggle. Co-authored-by: Yusuke Arakawa --- .../Status/Editor/Components/StatusEditorAccessoryView.swift | 1 + .../Status/Sources/Status/Editor/StatusEditorViewModel.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Packages/Status/Sources/Status/Editor/Components/StatusEditorAccessoryView.swift b/Packages/Status/Sources/Status/Editor/Components/StatusEditorAccessoryView.swift index 11b74018..f6323dbe 100644 --- a/Packages/Status/Sources/Status/Editor/Components/StatusEditorAccessoryView.swift +++ b/Packages/Status/Sources/Status/Editor/Components/StatusEditorAccessoryView.swift @@ -39,6 +39,7 @@ struct StatusEditorAccessoryView: View { Button { withAnimation { viewModel.showPoll.toggle() + viewModel.resetPollDefaults() } } label: { Image(systemName: "chart.bar") diff --git a/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift b/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift index 6c591d16..9355b880 100644 --- a/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift +++ b/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift @@ -99,7 +99,7 @@ public class StatusEditorViewModel: NSObject, ObservableObject { } var shouldDisablePollButton: Bool { - showPoll || !selectedMedias.isEmpty + !selectedMedias.isEmpty } var shouldDisplayDismissWarning: Bool {