Skip to content

Commit

Permalink
Sync create store
Browse files Browse the repository at this point in the history
  • Loading branch information
flypaper0 committed Jun 19, 2023
1 parent d40a93c commit d8b9365
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class WalletPushClient {
private let notifyUpdateRequester: NotifyUpdateRequester
private let notifyUpdateResponseSubscriber: NotifyUpdateResponseSubscriber
private let notifyProposeResponder: NotifyProposeResponder
private let subscriptionsStore: SyncStore<PushSubscription>

init(logger: ConsoleLogging,
kms: KeyManagementServiceProtocol,
Expand All @@ -65,7 +66,8 @@ public class WalletPushClient {
pushSubscribeResponseSubscriber: PushSubscribeResponseSubscriber,
notifyUpdateRequester: NotifyUpdateRequester,
notifyUpdateResponseSubscriber: NotifyUpdateResponseSubscriber,
notifyProposeResponder: NotifyProposeResponder
notifyProposeResponder: NotifyProposeResponder,
subscriptionsStore: SyncStore<PushSubscription>
) {
self.logger = logger
self.pairingRegisterer = pairingRegisterer
Expand All @@ -81,10 +83,12 @@ public class WalletPushClient {
self.notifyUpdateRequester = notifyUpdateRequester
self.notifyUpdateResponseSubscriber = notifyUpdateResponseSubscriber
self.notifyProposeResponder = notifyProposeResponder
self.subscriptionsStore = subscriptionsStore
setupSubscriptions()
}

public func subscribe(metadata: AppMetadata, account: Account, onSign: @escaping SigningCallback) async throws {
try await subscriptionsStore.initialize(for: account)
try await pushSubscribeRequester.subscribe(metadata: metadata, account: account, onSign: onSign)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public struct WalletPushClientFactory {
pushSubscribeResponseSubscriber: pushSubscribeResponseSubscriber,
notifyUpdateRequester: notifyUpdateRequester,
notifyUpdateResponseSubscriber: notifyUpdateResponseSubscriber,
notifyProposeResponder: notifyProposeResponder
notifyProposeResponder: notifyProposeResponder,
subscriptionsStore: subscriptionStore
)
}
}

0 comments on commit d8b9365

Please sign in to comment.