Skip to content

Commit 3087fb8

Browse files
committed
Paid Messages: Remove timer (#5850)
1 parent 92d9f07 commit 3087fb8

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

‎src/global/actions/api/bots.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from '../../../api/types';
1515
import { ManagementProgress } from '../../../types';
1616

17-
import { BOT_FATHER_USERNAME, GENERAL_REFETCH_INTERVAL, PAID_SEND_DELAY } from '../../../config';
17+
import { BOT_FATHER_USERNAME, GENERAL_REFETCH_INTERVAL } from '../../../config';
1818
import { copyTextToClipboard } from '../../../util/clipboard';
1919
import { getUsernameFromDeepLink } from '../../../util/deepLinkParser';
2020
import { getCurrentTabId } from '../../../util/establishMultitabRole';
@@ -438,21 +438,17 @@ addActionHandler('sendInlineBotResult', async (global, actions, payload): Promis
438438
return;
439439
}
440440

441+
// eslint-disable-next-line eslint-multitab-tt/no-getactions-in-actions
442+
actions.sendInlineBotApiResult({ ...params });
443+
441444
// eslint-disable-next-line eslint-multitab-tt/no-getactions-in-actions
442445
actions.showNotification({
443446
localId: queryId,
444447
title: { key: 'MessageSentPaidToastTitle', variables: { count: 1 }, options: { pluralValue: 1 } },
445448
message: {
446449
key: 'MessageSentPaidToastText', variables: { amount: formatStarsAsText(getTranslationFn(), starsForOneMessage) },
447450
},
448-
actionText: { key: 'ButtonUndo' },
449-
dismissAction: {
450-
action: 'sendInlineBotApiResult',
451-
payload: params,
452-
},
453-
duration: PAID_SEND_DELAY,
454-
shouldShowTimer: true,
455-
disableClickDismiss: true,
451+
456452
icon: 'star',
457453
shouldUseCustomIcon: true,
458454
type: 'paidMessage',

‎src/global/actions/api/messages.ts

+4-15
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
MAX_MEDIA_FILES_FOR_ALBUM,
3030
MESSAGE_ID_REQUIRED_ERROR,
3131
MESSAGE_LIST_SLICE,
32-
PAID_SEND_DELAY, RE_TELEGRAM_LINK,
32+
RE_TELEGRAM_LINK,
3333
SERVICE_NOTIFICATIONS_USER_ID,
3434
SUPPORTED_AUDIO_CONTENT_TYPES,
3535
SUPPORTED_PHOTO_CONTENT_TYPES,
@@ -1713,6 +1713,9 @@ async function sendMessagesWithNotification<T extends GlobalState>(
17131713
options: { pluralValue: messagesCount },
17141714
};
17151715

1716+
// eslint-disable-next-line eslint-multitab-tt/no-getactions-in-actions
1717+
getActions().sendMessages({ sendParams });
1718+
17161719
// eslint-disable-next-line eslint-multitab-tt/no-getactions-in-actions
17171720
getActions().showNotification({
17181721
localId: getMessageKey(firstMessage),
@@ -1721,20 +1724,6 @@ async function sendMessagesWithNotification<T extends GlobalState>(
17211724
key: 'MessageSentPaidToastText',
17221725
variables: { amount: formatStarsAsText(getTranslationFn(), starsForOneMessage * messagesCount) },
17231726
},
1724-
actionText: { key: 'ButtonUndo' },
1725-
action: {
1726-
action: 'deleteMessages',
1727-
payload: { messageList: firstSendParam.messageList, messageIds: messageIdsForUndo, shouldDeleteForAll: true },
1728-
},
1729-
dismissAction: {
1730-
action: 'sendMessages',
1731-
payload: {
1732-
sendParams,
1733-
},
1734-
},
1735-
duration: PAID_SEND_DELAY,
1736-
shouldShowTimer: true,
1737-
disableClickDismiss: true,
17381727
icon: 'star',
17391728
shouldUseCustomIcon: true,
17401729
type: 'paidMessage',

0 commit comments

Comments
 (0)