@@ -57,7 +57,10 @@ struct AboutView: View {
5757 @State private var removeUserData = false
5858 @State private var uninstalling = false
5959 @State private var uninstallFailed = false
60+ // The value is based on check update, and is only used for upgrading to release.
61+ // If upgrading/switching to debug, always use latest regardless of this value.
6062 @State private var targetTag : String ? = nil
63+ // If current version is latest, this is still true (for build type switch).
6164 @State private var latestAvailable = false
6265
6366 var body : some View {
@@ -169,7 +172,13 @@ struct AboutView: View {
169172 } label: {
170173 Text ( " Switch to Release " )
171174 } . disabled (
172- !latestAvailable || viewModel. state == . downloading || viewModel. state == . installing
175+ ( !latestAvailable
176+ && targetTag
177+ == nil // We should always allow debug build to switch to release build,
178+ // so we drop OS version support only immediately after a new tag release.
179+ // Plus we don't provide debug build for tag release, this condition shouldn't be true.
180+ )
181+ || viewModel. state == . downloading || viewModel. state == . installing
173182 )
174183 } else {
175184 Button {
@@ -333,7 +342,8 @@ struct AboutView: View {
333342 }
334343
335344 func update( debug: Bool ) {
336- guard let tag = latestAvailable ? " latest " : targetTag else {
345+ // See comment of targetTag.
346+ guard let tag = debug && latestAvailable ? " latest " : targetTag else {
337347 FCITX_ERROR ( " Calling update with nil tag " )
338348 return
339349 }
0 commit comments