Refactor ViewModel
This commit is contained in:
@@ -13,7 +13,7 @@ public struct CoreView: View {
|
||||
|
||||
public init() {}
|
||||
public var body: some View {
|
||||
viewBuilder {
|
||||
Group {
|
||||
if isLoading {
|
||||
ProgressView().onAppear {
|
||||
Task {
|
||||
|
||||
@@ -17,7 +17,7 @@ public struct AppView: View {
|
||||
|
||||
public init() {}
|
||||
public var body: some View {
|
||||
viewBuilder {
|
||||
Group {
|
||||
if isLoading {
|
||||
ProgressView().onAppear {
|
||||
Task {
|
||||
|
||||
@@ -8,7 +8,7 @@ public struct OnDemandRulesView: View {
|
||||
|
||||
public init() {}
|
||||
public var body: some View {
|
||||
viewBuilder {
|
||||
Group {
|
||||
if isLoading {
|
||||
ProgressView().onAppear {
|
||||
Task.detached {
|
||||
|
||||
@@ -14,7 +14,7 @@ struct PacketTunnelView: View {
|
||||
|
||||
init() {}
|
||||
var body: some View {
|
||||
viewBuilder {
|
||||
Group {
|
||||
if isLoading {
|
||||
ProgressView().onAppear {
|
||||
Task.detached {
|
||||
|
||||
@@ -9,7 +9,7 @@ public struct ProfileOverrideView: View {
|
||||
|
||||
public init() {}
|
||||
public var body: some View {
|
||||
viewBuilder {
|
||||
Group {
|
||||
if isLoading {
|
||||
ProgressView().onAppear {
|
||||
Task.detached {
|
||||
|
||||
@@ -12,7 +12,7 @@ public struct ServiceLogView: View {
|
||||
public init() {}
|
||||
|
||||
public var body: some View {
|
||||
viewBuilder {
|
||||
Group {
|
||||
if viewModel.isLoading {
|
||||
ProgressView().onAppear {
|
||||
Task {
|
||||
|
||||
@@ -57,7 +57,7 @@ public struct SettingView: View {
|
||||
|
||||
@MainActor
|
||||
var contentView: some View {
|
||||
viewBuilder {
|
||||
Group {
|
||||
switch self {
|
||||
#if os(macOS)
|
||||
case .app:
|
||||
|
||||
Reference in New Issue
Block a user