Skip to content

Commit

Permalink
MA-18060: add subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-nikitin-2022 committed Jun 26, 2024
1 parent 742bcb3 commit ec2b597
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/core/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,16 @@ export function createVKBridge(version: string): VKBridge {
}
}

subscribe((event) => {
if (!event.detail) {
return;
}
switch (event.detail.type) {
case 'SetSupportedHandlers':
supportedHandlers = event.detail.data.supportedHandlers;
}
});

return {
send: sendPromise,
sendPromise,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/types/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,7 @@ export type ReceiveEventMap = EventReceiveNames<
'VKWebAppCallGetStatusFailed'
> &
EventReceiveNames<'VKWebAppRecommend', 'VKWebAppRecommendResult', 'VKWebAppRecommendFailed'> &
EventReceiveNames<'SetSupportedHandlers', 'SetSupportedHandlers', 'SetSupportedHandlersFailed'> &
EventReceiveNames<
'VKWebAppAddToProfile',
'VKWebAppAddToProfileResult',
Expand Down

0 comments on commit ec2b597

Please sign in to comment.