@@ -121,13 +121,18 @@ struct PrivacyAccessSectionView: View {
|
121 | 121 | switch self.contactsStatus { |
122 | 122 | case .notDetermined: |
123 | 123 | Task { |
124 | | -_ = await PermissionRequestBridge.awaitRequest { completion in |
| 124 | +let granted = await PermissionRequestBridge.awaitRequest { completion in |
125 | 125 | let store = CNContactStore() |
126 | 126 | store.requestAccess(for: .contacts) { granted, _ in |
127 | 127 | completion(granted) |
128 | 128 | } |
129 | 129 | } |
130 | | -await MainActor.run { self.refreshAll() } |
| 130 | +await MainActor.run { |
| 131 | +self.refreshAll() |
| 132 | +if granted { |
| 133 | +self.contactsStatus = .authorized |
| 134 | +} |
| 135 | +} |
131 | 136 | } |
132 | 137 | case .denied, .restricted: |
133 | 138 | self.openSettings() |
@@ -164,8 +169,13 @@ struct PrivacyAccessSectionView: View {
|
164 | 169 | switch self.calendarStatus { |
165 | 170 | case .notDetermined: |
166 | 171 | Task { |
167 | | - _ = await self.requestCalendarWriteOnly() |
168 | | -await MainActor.run { self.refreshAll() } |
| 172 | +let granted = await self.requestCalendarWriteOnly() |
| 173 | +await MainActor.run { |
| 174 | +self.refreshAll() |
| 175 | +if granted { |
| 176 | +self.calendarStatus = .writeOnly |
| 177 | +} |
| 178 | +} |
169 | 179 | } |
170 | 180 | case .denied, .restricted: |
171 | 181 | self.openSettings() |
@@ -206,8 +216,13 @@ struct PrivacyAccessSectionView: View {
|
206 | 216 | switch self.calendarStatus { |
207 | 217 | case .notDetermined, .writeOnly: |
208 | 218 | Task { |
209 | | - _ = await self.requestCalendarFull() |
210 | | -await MainActor.run { self.refreshAll() } |
| 219 | +let granted = await self.requestCalendarFull() |
| 220 | +await MainActor.run { |
| 221 | +self.refreshAll() |
| 222 | +if granted { |
| 223 | +self.calendarStatus = .fullAccess |
| 224 | +} |
| 225 | +} |
211 | 226 | } |
212 | 227 | case .denied, .restricted: |
213 | 228 | self.openSettings() |
@@ -248,8 +263,13 @@ struct PrivacyAccessSectionView: View {
|
248 | 263 | switch self.remindersStatus { |
249 | 264 | case .notDetermined, .writeOnly: |
250 | 265 | Task { |
251 | | - _ = await self.requestRemindersFull() |
252 | | -await MainActor.run { self.refreshAll() } |
| 266 | +let granted = await self.requestRemindersFull() |
| 267 | +await MainActor.run { |
| 268 | +self.refreshAll() |
| 269 | +if granted { |
| 270 | +self.remindersStatus = .fullAccess |
| 271 | +} |
| 272 | +} |
253 | 273 | } |
254 | 274 | case .denied, .restricted: |
255 | 275 | self.openSettings() |
|