mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-23 15:50:26 +01:00
c453882b4b
Fixes #2182
33 lines
932 B
Swift
33 lines
932 B
Swift
//
|
|
// AdvancedPreferencesModel.swift
|
|
// Multiplatform macOS
|
|
//
|
|
// Created by Stuart Breckenridge on 16/7/20.
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class AdvancedPreferencesModel: ObservableObject {
|
|
|
|
let releaseBuildsURL = Bundle.main.infoDictionary!["SUFeedURL"]! as! String
|
|
let testBuildsURL = Bundle.main.infoDictionary!["FeedURLForTestBuilds"]! as! String
|
|
let appcastDefaultsKey = "SUFeedURL"
|
|
|
|
init() {
|
|
if AppDefaults.shared.downloadTestBuilds == false {
|
|
AppDefaults.store.setValue(releaseBuildsURL, forKey: appcastDefaultsKey)
|
|
} else {
|
|
AppDefaults.store.setValue(testBuildsURL, forKey: appcastDefaultsKey)
|
|
}
|
|
}
|
|
|
|
func updateAppcast() {
|
|
if AppDefaults.shared.downloadTestBuilds == false {
|
|
AppDefaults.store.setValue(releaseBuildsURL, forKey: appcastDefaultsKey)
|
|
} else {
|
|
AppDefaults.store.setValue(testBuildsURL, forKey: appcastDefaultsKey)
|
|
}
|
|
}
|
|
}
|