From cce4890f16d68ce1e1fdbe322d2c4d292bcca879 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 14 Sep 2022 00:30:20 +0200 Subject: [PATCH] Game Modal: Support sharing event (#2035) --- src/components/main/GameModal.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/main/GameModal.tsx b/src/components/main/GameModal.tsx index bb45ebe5a..a239c6479 100644 --- a/src/components/main/GameModal.tsx +++ b/src/components/main/GameModal.tsx @@ -32,7 +32,7 @@ type StateProps = { }; const GameModal: FC = ({ openedGame, gameTitle, canPost }) => { - const { closeGame, showNotification, openForwardMenu } = getActions(); + const { closeGame, openForwardMenu } = getActions(); const lang = useLang(); const { url, chatId, messageId } = openedGame || {}; const isOpen = Boolean(url); @@ -51,12 +51,13 @@ const GameModal: FC = ({ openedGame, gameTitle, canPost } } if (data.eventType === 'share_game') { - showNotification({ message: 'Unsupported game action' }); + openForwardMenu({ fromChatId: chatId, messageIds: [messageId] }); + closeGame(); } } catch (e) { // Ignore other messages } - }, [chatId, closeGame, messageId, openForwardMenu, showNotification]); + }, [chatId, closeGame, messageId, openForwardMenu]); const handleLoad = useCallback((event: React.SyntheticEvent) => { event.currentTarget.focus();