Skip to content

Commit 582c7dd

Browse files
authoredNov 4, 2020
fix(amplify): change reset method (#866)
* fixed failed syncEventEmitterTests * update reset * resettable? * trying to fix another bug * updated comment Co-authored-by: Guo <48600426+DongQuanRui@users.noreply.github.com>
1 parent 75a43d4 commit 582c7dd

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed
 

‎Amplify/Core/Configuration/Internal/Amplify+Reset.swift

+16-4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,26 @@ extension Amplify {
3232
reset(Auth, in: group) { group.leave() }
3333
case .dataStore:
3434
reset(DataStore, in: group) { group.leave() }
35-
case .hub:
36-
reset(Hub, in: group) { group.leave() }
37-
case .logging:
38-
reset(Logging, in: group) { group.leave() }
3935
case .storage:
4036
reset(Storage, in: group) { group.leave() }
4137
case .predictions:
4238
reset(Predictions, in: group) { group.leave() }
39+
case .hub, .logging:
40+
// Hub and Logging should be reset after all other categories
41+
break
42+
}
43+
}
44+
45+
group.wait()
46+
47+
for categoryType in CategoryType.allCases {
48+
switch categoryType {
49+
case .hub:
50+
reset(Hub, in: group) { group.leave() }
51+
case .logging:
52+
reset(Logging, in: group) { group.leave() }
53+
default:
54+
break
4355
}
4456
}
4557

0 commit comments

Comments
 (0)
Please sign in to comment.