fix whats new showing every time

prevAppVersoin wasnt being set lol
remove .searchable()
rename WhatsNew -> WhatsNewChunk
This commit is contained in:
neon443
2025-05-13 10:59:22 +01:00
parent c935d4b1f0
commit 2b266e03ca
5 changed files with 14 additions and 12 deletions

View File

@@ -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

View File

@@ -134,7 +134,6 @@ class SettingsViewModel: ObservableObject {
init(load: Bool = true) {
self.device = getDevice()
if load {
loadSettings()
Task {

View File

@@ -82,7 +82,6 @@ struct HomeView: View {
Spacer()
}
.animation(.default, value: filteredEvents)
.searchable(text: $searchInput)
}
}
.navigationTitle("Near Future")

View File

@@ -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 {

View File

@@ -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