@@ -12,11 +12,10 @@ struct StatusView: View {
12
12
@Environment ( \. dismiss) var dismiss // dismiss the sheet
13
13
14
14
@StateObject var injector = Injector . shared
15
- @State var appDetail : AppDetail = . init( name: " " , identifier: " " , version: " " , path: " " , executable: " " , icon: NSImage ( ) )
16
-
15
+
17
16
var body : some View {
18
17
VStack ( alignment: . leading, spacing: 10 ) {
19
- if appDetail. name. isEmpty {
18
+ if self . injector . appDetail? . name == nil {
20
19
Text ( " Why you are seeing this? " )
21
20
. font ( . title)
22
21
. bold ( )
@@ -45,18 +44,18 @@ struct StatusView: View {
45
44
// MARK: - App Info Display Box
46
45
47
46
HStack ( spacing: 20 ) {
48
- Image ( nsImage: appDetail. icon)
47
+ Image ( nsImage: self . injector . appDetail! . icon)
49
48
. resizable ( )
50
49
. frame ( width: 64 , height: 64 )
51
50
. cornerRadius ( 4 )
52
51
// Spacer()
53
52
VStack ( alignment: . leading, spacing: 4 ) {
54
- Text ( appDetail. name)
53
+ Text ( self . injector . appDetail! . name)
55
54
. font ( . headline)
56
- Text ( appDetail. identifier)
55
+ Text ( self . injector . appDetail! . identifier)
57
56
. font ( . subheadline)
58
57
. foregroundColor ( . secondary)
59
- Text ( " Version: \( appDetail. version) " )
58
+ Text ( " Version: \( self . injector . appDetail! . version) " )
60
59
. font ( . caption)
61
60
. foregroundColor ( . secondary)
62
61
}
@@ -155,20 +154,15 @@ struct StatusView: View {
155
154
. frame ( maxWidth: . infinity)
156
155
}
157
156
}
158
- . onChange ( of: injector. stage. appId) { appId in
159
- guard let appDetail = softwareManager. appListCache [ appId] else {
160
- return
161
- }
162
- self . appDetail = appDetail
163
- }
164
- . frame ( minWidth: 350 , minHeight: appDetail. name. isEmpty ? 200 : 400 )
157
+ // .onChange(of: injector.isRunning) { _ in
158
+ // let appId = injector.stage.appId
159
+ // guard let self.injector.appDetail = softwareManager.appListCache[appId] else {
160
+ // return
161
+ // }
162
+ // self.self.injector.appDetail = self.injector.appDetail
163
+ // }
164
+ . frame ( minWidth: 350 , minHeight: 400 )
165
165
. padding ( )
166
- . onAppear {
167
- guard let appDetail = softwareManager. appListCache [ injector. stage. appId] else {
168
- return
169
- }
170
- self . appDetail = appDetail
171
- }
172
166
. background ( Color ( . windowBackgroundColor) )
173
167
}
174
168
}
0 commit comments