Share latestCurrentAccountKey preference key for share extension

This commit is contained in:
Thomas Ricouard 2023-01-15 18:18:54 +01:00
parent 9098fdf515
commit b0ac1b4f57
2 changed files with 4 additions and 2 deletions

View file

@ -3,8 +3,10 @@ import Network
import Env
import Models
@MainActor
public class AppAccountsManager: ObservableObject {
@AppStorage("latestCurrentAccountKey") static public var latestCurrentAccountKey: String = ""
@AppStorage("latestCurrentAccountKey", store: UserPreferences.sharedDefault)
static public var latestCurrentAccountKey: String = ""
@Published public var currentAccount: AppAccount {
didSet {

View file

@ -5,7 +5,7 @@ import Network
@MainActor
public class UserPreferences: ObservableObject {
private static let sharedDefault = UserDefaults.init(suiteName: "group.icecubesapps")
public static let sharedDefault = UserDefaults.init(suiteName: "group.icecubesapps")
private var client: Client?