Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Amplify/Core/Configuration/AmplifyConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ extension Amplify {
static func notifyAllHubChannels() {
let payload = HubPayload(eventName: HubPayload.EventName.Amplify.configured)
for channel in HubChannel.amplifyChannels {
Hub.plugins.values.forEach { $0.dispatch(to: channel, payload: payload) }
Task {
Amplify.Hub.dispatch(to: channel, payload: payload)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion AmplifyTestCommon/Mocks/MockHubCategoryPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MockHubCategoryPlugin: MessageReporter, HubCategoryPlugin {
}

func dispatch(to channel: HubChannel, payload: HubPayload) {
notify("dispatch")
notify("\(payload.eventName)")
}

func listen(to channel: HubChannel,
Expand Down
2 changes: 1 addition & 1 deletion AmplifyTests/CategoryTests/Hub/HubClientAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class HubClientAPITests: XCTestCase {
}
}

Amplify.Hub.dispatch(to: .storage, payload: HubPayload(eventName: ""))
Amplify.Hub.dispatch(to: .storage, payload: HubPayload(eventName: "dispatch"))

await fulfillment(of: [methodWasInvokedOnPlugin], timeout: 0.5)
}
Expand Down
Loading