Refactor ViewModel

This commit is contained in:
世界
2025-12-01 17:11:34 +08:00
parent 30492c1191
commit 8e764c56eb
34 changed files with 136 additions and 160 deletions
@@ -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: