blob: bfcdf1c6e7d0502d7f219f4f6f625b8634a3d12f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
//
// RootConfiguration.swift
// MullvadVPN
//
// Created by Jon Petersson on 2023-04-19.
// Copyright © 2023 Mullvad VPN AB. All rights reserved.
//
import Foundation
import MullvadSettings
struct RootDeviceInfoViewModel {
let configuration: RootConfiguration
init(isPresentingAccountExpiryBanner: Bool, deviceState: DeviceState) {
configuration = RootConfiguration(
deviceName: deviceState.deviceData?.capitalizedName,
expiry: (isPresentingAccountExpiryBanner || (deviceState.accountData?.isExpired ?? true))
? nil
: deviceState.accountData?.expiry,
showsAccountButton: deviceState.isLoggedIn
)
}
}
struct RootConfiguration {
var deviceName: String?
var expiry: Date?
var showsAccountButton: Bool
}
|