mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-06 04:40:07 +01:00
👌 Initial loading state for services manager
This commit is contained in:
@@ -15,7 +15,7 @@ class ServicesManager: ObservableObject {
|
|||||||
|
|
||||||
@Published var services = [Service]()
|
@Published var services = [Service]()
|
||||||
|
|
||||||
@Published @MainActor var firstRunComplete: Bool = false
|
@Published var firstRunComplete: Bool = false
|
||||||
|
|
||||||
public static func useFake() {
|
public static func useFake() {
|
||||||
ServicesManager.shared = FakeServicesManager.init(
|
ServicesManager.shared = FakeServicesManager.init(
|
||||||
@@ -35,7 +35,7 @@ class ServicesManager: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var statusMessage: String {
|
public var statusMessage: String {
|
||||||
if self.services.isEmpty {
|
if self.services.isEmpty || !self.firstRunComplete {
|
||||||
return "Loading..."
|
return "Loading..."
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ class ServicesManager: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var statusColor: Color {
|
public var statusColor: Color {
|
||||||
if self.services.isEmpty {
|
if self.services.isEmpty || !self.firstRunComplete {
|
||||||
return .yellow
|
return .yellow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user