mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-08 04:54:47 +02:00
29 lines
675 B
Swift
29 lines
675 B
Swift
//
|
|
// Store.swift
|
|
// App
|
|
//
|
|
// Created by Rasmus Krämer on 11.04.22.
|
|
//
|
|
|
|
import Foundation
|
|
import RealmSwift
|
|
|
|
class Store {
|
|
@ThreadSafe private static var _serverConfig: ServerConnectionConfig?
|
|
public static var serverConfig: ServerConnectionConfig? {
|
|
get {
|
|
return _serverConfig
|
|
}
|
|
set(updated) {
|
|
if updated != nil {
|
|
Database.shared.setServerConnectionConfig(config: updated!)
|
|
} else {
|
|
Database.shared.setLastActiveConfigIndexToNil()
|
|
}
|
|
|
|
Database.realmQueue.sync {
|
|
_serverConfig = updated
|
|
}
|
|
}
|
|
}
|
|
}
|