From 2b266e03ca659e4f56d1edf98ccff65b1efcfdc4 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Tue, 13 May 2025 10:59:22 +0100 Subject: [PATCH] fix whats new showing every time prevAppVersoin wasnt being set lol remove .searchable() rename WhatsNew -> WhatsNewChunk --- Config.xcconfig | 2 +- NearFuture/Item.swift | 1 - NearFuture/Views/Home/HomeView.swift | 1 - NearFuture/Views/Settings/SettingsView.swift | 4 ++++ NearFuture/Views/Settings/WhatsNewView.swift | 18 +++++++++--------- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Config.xcconfig b/Config.xcconfig index 36f1a68..5647221 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -14,4 +14,4 @@ BUNDLE_ID_WIDGETS = com.neon443.NearFuture.widgets GROUP_ID = group.NearFuture VERSION = 4.0.0 NAME = Near Future -BUILD_NUMBER = 2 +BUILD_NUMBER = 3 diff --git a/NearFuture/Item.swift b/NearFuture/Item.swift index 77ff9d2..c0a4930 100644 --- a/NearFuture/Item.swift +++ b/NearFuture/Item.swift @@ -134,7 +134,6 @@ class SettingsViewModel: ObservableObject { init(load: Bool = true) { self.device = getDevice() - if load { loadSettings() Task { diff --git a/NearFuture/Views/Home/HomeView.swift b/NearFuture/Views/Home/HomeView.swift index d551fd4..8d4fed1 100644 --- a/NearFuture/Views/Home/HomeView.swift +++ b/NearFuture/Views/Home/HomeView.swift @@ -82,7 +82,6 @@ struct HomeView: View { Spacer() } .animation(.default, value: filteredEvents) - .searchable(text: $searchInput) } } .navigationTitle("Near Future") diff --git a/NearFuture/Views/Settings/SettingsView.swift b/NearFuture/Views/Settings/SettingsView.swift index 1a64204..cfe194d 100644 --- a/NearFuture/Views/Settings/SettingsView.swift +++ b/NearFuture/Views/Settings/SettingsView.swift @@ -67,6 +67,10 @@ struct SettingsView: View { } } } + Toggle("Show completed Events in Home", isOn: $settingsModel.settings.showCompletedInHome) + .onChange(of: settingsModel.settings.showCompletedInHome) { _ in + settingsModel.saveSettings() + } NavigationLink() { List { if !settingsModel.notifsGranted { diff --git a/NearFuture/Views/Settings/WhatsNewView.swift b/NearFuture/Views/Settings/WhatsNewView.swift index 8a03ff5..e3a7c1d 100644 --- a/NearFuture/Views/Settings/WhatsNewView.swift +++ b/NearFuture/Views/Settings/WhatsNewView.swift @@ -10,25 +10,25 @@ import SwiftUI struct WhatsNewView: View { @ObservedObject var settingsModel: SettingsViewModel @Environment(\.dismiss) var dismiss - struct WhatsNew: Identifiable { + struct WhatsNewChunk: Identifiable { var id: UUID = UUID() var symbol: String var title: String var subtitle: String } - var whatsNew: [WhatsNew] { + var whatsNewChunks: [WhatsNewChunk] { return [ - WhatsNew( + WhatsNewChunk( symbol: settingsModel.device.sf, title: "This Screen", subtitle: "This update add a Whats New page that will tell you (suprise!) What's New" ), - WhatsNew( + WhatsNewChunk( symbol: "bell.badge.fill", title: "Notifications", subtitle: "Events now have notifications, reminding you to complete them!" ), - WhatsNew( + WhatsNewChunk( symbol: "list.bullet.indent", title: "Animations!", subtitle: "I added animations for adding, removing and ticking events" @@ -44,8 +44,8 @@ struct WhatsNewView: View { .bold() AboutView() Divider() - ForEach(whatsNew) { new in - WhatsNewChunk( + ForEach(whatsNewChunks) { new in + WhatsNewChunkView( symbol: new.symbol, title: new.title, subtitle: new.subtitle @@ -54,7 +54,7 @@ struct WhatsNewView: View { } .onDisappear { - settingsModel.settings.showWhatsNew = false + settingsModel.settings.prevAppVersion = getVersion()+getBuildID() settingsModel.saveSettings() } } @@ -89,7 +89,7 @@ struct WhatsNewView: View { } } -struct WhatsNewChunk: View { +struct WhatsNewChunkView: View { @State var symbol: String @State var title: String @State var subtitle: String