diff --git a/claw.xcodeproj/project.pbxproj b/claw.xcodeproj/project.pbxproj index 1fc3465..43f7de7 100644 --- a/claw.xcodeproj/project.pbxproj +++ b/claw.xcodeproj/project.pbxproj @@ -810,7 +810,7 @@ ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; CODE_SIGN_ENTITLEMENTS = hottest.widgetExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = C6L3992RFB; INFOPLIST_FILE = hottest.widget/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -818,7 +818,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.1.5; + MARKETING_VERSION = 1.1.6; PRODUCT_BUNDLE_IDENTIFIER = "com.twodayslate.claw.hottest-widget"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -834,7 +834,7 @@ ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; CODE_SIGN_ENTITLEMENTS = hottest.widgetExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = C6L3992RFB; INFOPLIST_FILE = hottest.widget/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -842,7 +842,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.1.5; + MARKETING_VERSION = 1.1.6; PRODUCT_BUNDLE_IDENTIFIER = "com.twodayslate.claw.hottest-widget"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -975,7 +975,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = claw/claw.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"claw/Preview Content\""; DEVELOPMENT_TEAM = C6L3992RFB; ENABLE_PREVIEWS = YES; @@ -985,7 +985,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.5; + MARKETING_VERSION = 1.1.6; PRODUCT_BUNDLE_IDENTIFIER = com.twodayslate.claw; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = NO; @@ -1003,7 +1003,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = claw/claw.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"claw/Preview Content\""; DEVELOPMENT_TEAM = C6L3992RFB; ENABLE_PREVIEWS = YES; @@ -1013,7 +1013,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.5; + MARKETING_VERSION = 1.1.6; PRODUCT_BUNDLE_IDENTIFIER = com.twodayslate.claw; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = NO; @@ -1113,7 +1113,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "opener-action/opener-action.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = C6L3992RFB; INFOPLIST_FILE = "opener-action/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.1; @@ -1122,7 +1122,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.1.5; + MARKETING_VERSION = 1.1.6; PRODUCT_BUNDLE_IDENTIFIER = "com.twodayslate.claw.opener-action"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1137,7 +1137,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "opener-action/opener-action.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = C6L3992RFB; INFOPLIST_FILE = "opener-action/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.1; @@ -1146,7 +1146,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.1.5; + MARKETING_VERSION = 1.1.6; PRODUCT_BUNDLE_IDENTIFIER = "com.twodayslate.claw.opener-action"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/claw/Stories/Hottest/HottestFetcher.swift b/claw/Stories/Hottest/HottestFetcher.swift index abb4f63..d0217ec 100644 --- a/claw/Stories/Hottest/HottestFetcher.swift +++ b/claw/Stories/Hottest/HottestFetcher.swift @@ -9,6 +9,10 @@ class HottestFetcher: ObservableObject { @Published var isLoadingMore = false @Published var isReloading = false + // we need a shared object as a not singleton will be deinitialized after about 2 + // navigation views deep + static var shared = HottestFetcher() + init() { load() } diff --git a/claw/Stories/Hottest/HottestView.swift b/claw/Stories/Hottest/HottestView.swift index e69f8cf..81befcb 100644 --- a/claw/Stories/Hottest/HottestView.swift +++ b/claw/Stories/Hottest/HottestView.swift @@ -2,7 +2,7 @@ import Foundation import SwiftUI struct HottestView: View { - @ObservedObject var hottest = HottestFetcher() + @ObservedObject var hottest = HottestFetcher.shared @EnvironmentObject var settings: Settings @Environment(\.didReselect) var didReselect @State var isVisible = false diff --git a/claw/Stories/Newest/NewestFetcher.swift b/claw/Stories/Newest/NewestFetcher.swift index 5451a9a..056da24 100644 --- a/claw/Stories/Newest/NewestFetcher.swift +++ b/claw/Stories/Newest/NewestFetcher.swift @@ -19,6 +19,8 @@ class NewestFetcher: ObservableObject { load() } + static var shared = NewestFetcher() + deinit { self.session?.cancel() self.moreSession?.cancel() diff --git a/claw/Stories/Newest/NewestView.swift b/claw/Stories/Newest/NewestView.swift index 609de94..79df443 100644 --- a/claw/Stories/Newest/NewestView.swift +++ b/claw/Stories/Newest/NewestView.swift @@ -2,7 +2,7 @@ import SwiftUI struct NewestView: View { - @ObservedObject var newest = NewestFetcher() + @ObservedObject var newest = NewestFetcher.shared @EnvironmentObject var settings: Settings @Environment(\.didReselect) var didReselect @State var isVisible = false