mirror of
https://github.com/neon443/NearFuture.git
synced 2026-03-11 06:49:12 +00:00
fix whats new showing every time
prevAppVersoin wasnt being set lol remove .searchable() rename WhatsNew -> WhatsNewChunk
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -134,7 +134,6 @@ class SettingsViewModel: ObservableObject {
|
||||
|
||||
init(load: Bool = true) {
|
||||
self.device = getDevice()
|
||||
|
||||
if load {
|
||||
loadSettings()
|
||||
Task {
|
||||
|
||||
@@ -82,7 +82,6 @@ struct HomeView: View {
|
||||
Spacer()
|
||||
}
|
||||
.animation(.default, value: filteredEvents)
|
||||
.searchable(text: $searchInput)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Near Future")
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user