Create shared AppDefaults and delete platform-specific AppDefaults.

This commit is contained in:
Brent Simmons
2025-01-26 21:06:22 -08:00
parent d9d47749ef
commit 2f12d9f803
46 changed files with 858 additions and 895 deletions

View File

@@ -13,8 +13,8 @@ struct AddFeedDefaultContainer {
static var defaultContainer: Container? {
if let accountID = AppDefaults.shared.addFeedAccountID, let account = AccountManager.shared.activeAccounts.first(where: { $0.accountID == accountID }) {
if let folderName = AppDefaults.shared.addFeedFolderName, let folder = account.existingFolder(withDisplayName: folderName) {
if let accountID = AppDefaults.addFeedAccountID, let account = AccountManager.shared.activeAccounts.first(where: { $0.accountID == accountID }) {
if let folderName = AppDefaults.addFeedFolderName, let folder = account.existingFolder(withDisplayName: folderName) {
return folder
} else {
return substituteContainerIfNeeded(account: account)
@@ -28,11 +28,11 @@ struct AddFeedDefaultContainer {
}
static func saveDefaultContainer(_ container: Container) {
AppDefaults.shared.addFeedAccountID = container.account?.accountID
AppDefaults.addFeedAccountID = container.account?.accountID
if let folder = container as? Folder {
AppDefaults.shared.addFeedFolderName = folder.nameForDisplay
AppDefaults.addFeedFolderName = folder.nameForDisplay
} else {
AppDefaults.shared.addFeedFolderName = nil
AppDefaults.addFeedFolderName = nil
}
}