iOS/Sources/Extensions/Watch/Home/WatchHomeViewModel.swift

15 lines
389 B
Swift

import Communicator
import Foundation
import NetworkExtension
import PromiseKit
import Shared
final class WatchHomeViewModel: ObservableObject {
func fetchNetworkInfo(completion: (() -> Void)? = nil) {
NEHotspotNetwork.fetchCurrent { hotspotNetwork in
WatchUserDefaults.shared.set(hotspotNetwork?.ssid, key: .watchSSID)
completion?()
}
}
}