File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
ApplicationLibrary/Views/Profile Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ public struct EditProfileView: View {
166166 #else
167167 try await ProfileUpdateTask . configure ( )
168168 #endif
169+ try await profile. onProfileUpdated ( )
169170 } catch {
170171 alert = Alert ( error)
171172 return
Original file line number Diff line number Diff line change @@ -13,8 +13,26 @@ public extension Profile {
1313 if let error {
1414 throw error
1515 }
16- try write ( remoteContent)
1716 lastUpdated = Date ( )
1817 try await ProfileManager . update ( self )
18+ do {
19+ let oldContent = try read ( )
20+ if oldContent == remoteContent {
21+ return
22+ }
23+ } catch { }
24+ try write ( remoteContent)
25+ try await onProfileUpdated ( )
26+ }
27+
28+ nonisolated func onProfileUpdated( ) async throws {
29+ if await SharedPreferences . selectedProfileID. get ( ) == id {
30+ if let profile = try ? await ExtensionProfile . load ( ) {
31+ if profile. status == . connected {
32+ try LibboxNewStandaloneCommandClient ( ) !. serviceReload ( )
33+ }
34+ }
35+ }
1936 }
37+
2038}
You can’t perform that action at this time.
0 commit comments