Skip to content

Commit 1f2b348

Browse files
committed
paid reactions impl
1 parent 6b6512c commit 1f2b348

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1201
-475
lines changed

‎eslint.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default [{
148148
'@typescript-eslint/await-thenable': 'error'
149149
}
150150
}, {
151-
files: ['**/*.ts'],
151+
files: ['**/*.ts', '**/*.tsx'],
152152

153153
languageOptions: {
154154
ecmaVersion: 5,

‎index.html

-27
Original file line numberDiff line numberDiff line change
@@ -72,33 +72,6 @@
7272
<path d="M-6 16h6v17c-.193-2.84-.876-5.767-2.05-8.782-.904-2.325-2.446-4.485-4.625-6.48A1 1 0 01-6 16z" transform="matrix(1 0 0 -1 0 49)" id="corner-fill" fill="inherit"/>
7373
</g>
7474
</symbol>
75-
<symbol id="paid-reaction-background" viewBox="0 0 59 37">
76-
<g opacity="0.3">
77-
<path d="M21.9985 12C22.1433 12 22.2555 11.8966 22.2792 11.7458C22.5451 9.77438 22.8198 9.49655 24.7341 9.28374C24.8848 9.26601 25 9.14483 25 9C25 8.85222 24.8877 8.73399 24.7371 8.71626C22.8257 8.48867 22.5628 8.22266 22.2792 6.25419C22.2555 6.10345 22.1403 6 21.9985 6C21.8567 6 21.7415 6.10345 21.7179 6.25419C21.452 8.22562 21.1773 8.50345 19.2659 8.71626C19.1123 8.73399 19 8.85222 19 9C19 9.14483 19.1093 9.26305 19.2629 9.28374C21.1743 9.54089 21.4254 9.77734 21.7179 11.7458C21.7445 11.8966 21.8597 12 21.9985 12Z" fill="inherit"/>
78-
</g>
79-
<path d="M7.99852 37C8.14328 37 8.25554 36.8966 8.27917 36.7458C8.54505 34.7744 8.81979 34.4966 10.7341 34.2837C10.8848 34.266 11 34.1448 11 34C11 33.8522 10.8877 33.734 10.7371 33.7163C8.8257 33.4887 8.56278 33.2227 8.27917 31.2542C8.25554 31.1034 8.14033 31 7.99852 31C7.85672 31 7.74151 31.1034 7.71787 31.2542C7.45199 33.2256 7.17725 33.5034 5.26588 33.7163C5.11226 33.734 5 33.8522 5 34C5 34.1448 5.10931 34.2631 5.26292 34.2837C7.1743 34.5409 7.42541 34.7773 7.71787 36.7458C7.74446 36.8966 7.85968 37 7.99852 37Z" fill="inherit" fill-opacity="0.5"/>
80-
<path d="M55.9985 28C56.1433 28 56.2555 27.8966 56.2792 27.7458C56.5451 25.7744 56.8198 25.4966 58.7341 25.2837C58.8848 25.266 59 25.1448 59 25C59 24.8522 58.8877 24.734 58.7371 24.7163C56.8257 24.4887 56.5628 24.2227 56.2792 22.2542C56.2555 22.1034 56.1403 22 55.9985 22C55.8567 22 55.7415 22.1034 55.7179 22.2542C55.452 24.2256 55.1773 24.5034 53.2659 24.7163C53.1123 24.734 53 24.8522 53 25C53 25.1448 53.1093 25.2631 53.2629 25.2837C55.1743 25.5409 55.4254 25.7773 55.7179 27.7458C55.7445 27.8966 55.8597 28 55.9985 28Z" fill="inherit" fill-opacity="0.5"/>
81-
<g opacity="0.5">
82-
<path d="M4.99902 12C5.09552 12 5.17036 11.931 5.18612 11.8305C5.36337 10.5163 5.54653 10.331 6.82275 10.1892C6.92319 10.1773 7 10.0966 7 10C7 9.90148 6.92516 9.82266 6.82472 9.81084C5.55047 9.65911 5.37518 9.48177 5.18612 8.16946C5.17036 8.06897 5.09355 8 4.99902 8C4.90448 8 4.82767 8.06897 4.81192 8.16946C4.63466 9.48374 4.4515 9.66897 3.17725 9.81084C3.07484 9.82266 3 9.90148 3 10C3 10.0966 3.07287 10.1754 3.17528 10.1892C4.44953 10.3606 4.61694 10.5182 4.81192 11.8305C4.82964 11.931 4.90645 12 4.99902 12Z" fill="inherit"/>
83-
</g>
84-
<g opacity="0.5">
85-
<path d="M24.999 32C25.0955 32 25.1704 31.931 25.1861 31.8305C25.3634 30.5163 25.5465 30.331 26.8227 30.1892C26.9232 30.1773 27 30.0966 27 30C27 29.9015 26.9252 29.8227 26.8247 29.8108C25.5505 29.6591 25.3752 29.4818 25.1861 28.1695C25.1704 28.069 25.0935 28 24.999 28C24.9045 28 24.8277 28.069 24.8119 28.1695C24.6347 29.4837 24.4515 29.669 23.1773 29.8108C23.0748 29.8227 23 29.9015 23 30C23 30.0966 23.0729 30.1754 23.1753 30.1892C24.4495 30.3606 24.6169 30.5182 24.8119 31.8305C24.8296 31.931 24.9065 32 24.999 32Z" fill="inherit"/>
86-
</g>
87-
<g opacity="0.5">
88-
<path d="M35.999 27C36.0955 27 36.1704 26.931 36.1861 26.8305C36.3634 25.5163 36.5465 25.331 37.8227 25.1892C37.9232 25.1773 38 25.0966 38 25C38 24.9015 37.9252 24.8227 37.8247 24.8108C36.5505 24.6591 36.3752 24.4818 36.1861 23.1695C36.1704 23.069 36.0935 23 35.999 23C35.9045 23 35.8277 23.069 35.8119 23.1695C35.6347 24.4837 35.4515 24.669 34.1773 24.8108C34.0748 24.8227 34 24.9015 34 25C34 25.0966 34.0729 25.1754 34.1753 25.1892C35.4495 25.3606 35.6169 25.5182 35.8119 26.8305C35.8296 26.931 35.9065 27 35.999 27Z" fill="inherit"/>
89-
</g>
90-
<g opacity="0.5">
91-
<path d="M37.999 7C38.0955 7 38.1704 6.93103 38.1861 6.83054C38.3634 5.51626 38.5465 5.33103 39.8227 5.18916C39.9232 5.17734 40 5.09655 40 5C40 4.90148 39.9252 4.82266 39.8247 4.81084C38.5505 4.65911 38.3752 4.48177 38.1861 3.16946C38.1704 3.06897 38.0935 3 37.999 3C37.9045 3 37.8277 3.06897 37.8119 3.16946C37.6347 4.48374 37.4515 4.66897 36.1773 4.81084C36.0748 4.82266 36 4.90148 36 5C36 5.09655 36.0729 5.17537 36.1753 5.18916C37.4495 5.36059 37.6169 5.51823 37.8119 6.83054C37.8296 6.93103 37.9065 7 37.999 7Z" fill="inherit"/>
92-
</g>
93-
<g opacity="0.5">
94-
<path d="M43.999 36C44.0955 36 44.1704 35.931 44.1861 35.8305C44.3634 34.5163 44.5465 34.331 45.8227 34.1892C45.9232 34.1773 46 34.0966 46 34C46 33.9015 45.9252 33.8227 45.8247 33.8108C44.5505 33.6591 44.3752 33.4818 44.1861 32.1695C44.1704 32.069 44.0935 32 43.999 32C43.9045 32 43.8277 32.069 43.8119 32.1695C43.6347 33.4837 43.4515 33.669 42.1773 33.8108C42.0748 33.8227 42 33.9015 42 34C42 34.0966 42.0729 34.1754 42.1753 34.1892C43.4495 34.3606 43.6169 34.5182 43.8119 35.8305C43.8296 35.931 43.9065 36 43.999 36Z" fill="inherit"/>
95-
</g>
96-
<g opacity="0.4">
97-
<path d="M10.999 4C11.0955 4 11.1704 3.93103 11.1861 3.83054C11.3634 2.51626 11.5465 2.33103 12.8227 2.18916C12.9232 2.17734 13 2.09655 13 2C13 1.90148 12.9252 1.82266 12.8247 1.81084C11.5505 1.65911 11.3752 1.48177 11.1861 0.169458C11.1704 0.0689655 11.0935 0 10.999 0C10.9045 0 10.8277 0.0689655 10.8119 0.169458C10.6347 1.48374 10.4515 1.66897 9.17725 1.81084C9.07484 1.82266 9 1.90148 9 2C9 2.09655 9.07287 2.17537 9.17528 2.18916C10.4495 2.36059 10.6169 2.51823 10.8119 3.83054C10.8296 3.93103 10.9065 4 10.999 4Z" fill="inherit"/>
98-
</g>
99-
<path d="M1.99902 25C2.09552 25 2.17036 24.931 2.18612 24.8305C2.36337 23.5163 2.54653 23.331 3.82275 23.1892C3.92319 23.1773 4 23.0966 4 23C4 22.9015 3.92516 22.8227 3.82472 22.8108C2.55047 22.6591 2.37518 22.4818 2.18612 21.1695C2.17036 21.069 2.09355 21 1.99902 21C1.90448 21 1.82767 21.069 1.81192 21.1695C1.63466 22.4837 1.4515 22.669 0.177253 22.8108C0.07484 22.8227 0 22.9015 0 23C0 23.0966 0.0728705 23.1754 0.175283 23.1892C1.44953 23.3606 1.61694 23.5182 1.81192 24.8305C1.82964 24.931 1.90645 25 1.99902 25Z" fill="inherit"/>
100-
<path d="M53.999 13C54.0955 13 54.1704 12.931 54.1861 12.8305C54.3634 11.5163 54.5465 11.331 55.8227 11.1892C55.9232 11.1773 56 11.0966 56 11C56 10.9015 55.9252 10.8227 55.8247 10.8108C54.5505 10.6591 54.3752 10.4818 54.1861 9.16946C54.1704 9.06897 54.0935 9 53.999 9C53.9045 9 53.8277 9.06897 53.8119 9.16946C53.6347 10.4837 53.4515 10.669 52.1773 10.8108C52.0748 10.8227 52 10.9015 52 11C52 11.0966 52.0729 11.1754 52.1753 11.1892C53.4495 11.3606 53.6169 11.5182 53.8119 12.8305C53.8296 12.931 53.9065 13 53.999 13Z" fill="inherit"/>
101-
</symbol>
10275
<linearGradient id="paint0_linear_6651_5783" x1="12.1999" y1="-1.71024" x2="12.1999" y2="25.2914" gradientUnits="userSpaceOnUse">
10376
<stop stop-color="#FFF0C2"/>
10477
<stop offset="1" stop-color="#FFEBBA"/>
2.29 KB
Binary file not shown.
5.4 KB
Loading

‎public/assets/tgs/StarReaction.json

+1
Large diffs are not rendered by default.

‎public/assets/tgs/StarReactionAppear.json

+1
Large diffs are not rendered by default.

‎public/assets/tgs/StarReactionEffect1.json

+1
Large diffs are not rendered by default.

‎public/assets/tgs/StarReactionEffect2.json

+1
Large diffs are not rendered by default.

‎public/assets/tgs/StarReactionEffect3.json

+1
Large diffs are not rendered by default.

‎public/assets/tgs/StarReactionSelect.json

+1
Large diffs are not rendered by default.

‎src/components/animatedCounter.ts

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import {AnimatedSuper} from './animatedSuper.js';
2+
3+
export interface AnimatedCounterOptions {
4+
reverse?: boolean;
5+
duration?: number;
6+
}
7+
8+
export class AnimatedCounter {
9+
static EMPTY_INDEX = -1;
10+
static BASE_CLASS = 'animated-counter';
11+
container: HTMLElement;
12+
decimals: {
13+
container: HTMLElement,
14+
placeholder: HTMLElement,
15+
animatedSuper: AnimatedSuper
16+
}[] = [];
17+
previousNumber = 0;
18+
clearTimeout: number;
19+
20+
reverse: AnimatedCounterOptions['reverse'];
21+
duration: AnimatedCounterOptions['duration'];
22+
23+
constructor(options: AnimatedCounterOptions) {
24+
this.reverse = options.reverse;
25+
this.duration = options.duration ?? AnimatedSuper.DEFAULT_DURATION;
26+
this.container = document.createElement('div');
27+
this.container.className = AnimatedCounter.BASE_CLASS;
28+
}
29+
30+
getDecimal(index: number) {
31+
if(this.decimals[index]) return this.decimals[index];
32+
const item = document.createElement('div');
33+
item.className = AnimatedCounter.BASE_CLASS + '-decimal';
34+
35+
const placeholder = document.createElement('div');
36+
placeholder.className = AnimatedCounter.BASE_CLASS + '-decimal-placeholder';
37+
38+
const animatedSuper = new AnimatedSuper({duration: this.duration});
39+
animatedSuper.container.className = AnimatedCounter.BASE_CLASS + '-decimal-wrapper';
40+
41+
item.append(placeholder, animatedSuper.container);
42+
43+
this.container.append(item);
44+
45+
return this.decimals[index] = {container: item, placeholder, animatedSuper};
46+
}
47+
48+
clear(number: number) {
49+
if(this.clearTimeout) clearTimeout(this.clearTimeout);
50+
51+
const decimals = ('' + number).length;
52+
if(decimals >= this.decimals.length) {
53+
return;
54+
}
55+
56+
this.clearTimeout = window.setTimeout(() => {
57+
const byDecimal = this.decimals.splice(decimals, this.decimals.length - decimals);
58+
byDecimal.forEach((decimal) => {
59+
decimal.container.remove();
60+
});
61+
}, this.duration);
62+
}
63+
64+
hideLeft(number: number) {
65+
const decimals = ('' + number).length;
66+
const byDecimal = this.decimals.slice(decimals);// this.decimals.splice(deleteCount, this.decimals.length - deleteCount);
67+
byDecimal.forEach((decimal) => {
68+
const previousDecimalNumber = +decimal.placeholder.innerText || 0;
69+
const row = decimal.animatedSuper.getRow(AnimatedCounter.EMPTY_INDEX, true);
70+
decimal.animatedSuper.animate(AnimatedCounter.EMPTY_INDEX, previousDecimalNumber, this.reverse ? number < this.previousNumber : number > this.previousNumber, true);
71+
});
72+
73+
this.clear(number);
74+
}
75+
76+
setCount(number: number) {
77+
// this.prepareNumber(number);
78+
79+
const previousByDecimal = Array.from('' + this.previousNumber).map((n) => +n);
80+
const byDecimal = Array.from('' + number).map((n) => +n);
81+
byDecimal.forEach((decimalNumber, idx) => {
82+
const decimal = this.getDecimal(idx);
83+
const row = decimal.animatedSuper.getRow(decimalNumber, true);
84+
const previousDecimalNumber = previousByDecimal[idx] ?? AnimatedCounter.EMPTY_INDEX;
85+
row.innerText = decimal.placeholder.innerText = '' + decimalNumber;
86+
decimal.animatedSuper.animate(decimalNumber, previousDecimalNumber, this.reverse ? number < this.previousNumber : number > this.previousNumber, true);
87+
});
88+
89+
this.hideLeft(number);
90+
// this.clear(number);
91+
this.previousNumber = number;
92+
}
93+
94+
destroy() {
95+
this.decimals.forEach((decimal) => {
96+
decimal.animatedSuper.destroy();
97+
});
98+
}
99+
}

‎src/components/animatedSuper.ts

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import {getMiddleware, MiddlewareHelper} from '../helpers/middleware.js';
2+
3+
export interface AnimatedSuperOptions {
4+
duration?: number;
5+
}
6+
7+
export class AnimatedSuper {
8+
static BASE_CLASS = 'animated-super';
9+
static DEFAULT_DURATION = 200;
10+
container: HTMLDivElement;
11+
rows: {[index: string]: {element: HTMLElement, middleware: MiddlewareHelper, timeout?: number, new?: true}} = {};
12+
clearTimeout: number;
13+
14+
duration: AnimatedSuperOptions['duration'];
15+
constructor(options?: AnimatedSuperOptions) {
16+
this.duration = options?.duration ?? AnimatedSuper.DEFAULT_DURATION;
17+
this.container = document.createElement('div');
18+
this.container.className = AnimatedSuper.BASE_CLASS;
19+
}
20+
21+
public getRow(index: number, animateFirst = false) {
22+
if(this.rows[index]) return this.rows[index].element;
23+
const row = document.createElement('div');
24+
const isFirst = !Object.keys(this.rows).length && !animateFirst;
25+
row.className = AnimatedSuper.BASE_CLASS + '-row' + (isFirst ? '' : ' is-hiding hide');
26+
this.rows[index] = {element: row, middleware: row.middlewareHelper = getMiddleware(), new: true};
27+
this.container.append(row);
28+
return row;
29+
}
30+
31+
public clearRow(index: number) {
32+
if(!this.rows[index]) return;
33+
this.rows[index].element.remove();
34+
this.rows[index].middleware.destroy();
35+
delete this.rows[index];
36+
}
37+
38+
public clearRows(currentIndex?: number) {
39+
if(this.clearTimeout) clearTimeout(this.clearTimeout);
40+
this.clearTimeout = window.setTimeout(() => {
41+
for(const i in this.rows) {
42+
if(+i === currentIndex) continue;
43+
this.clearRow(+i);
44+
}
45+
}, this.duration);
46+
}
47+
48+
public setNewRow(index: number, reflow = false) {
49+
const row = this.rows[index];
50+
if(row.new) {
51+
if(reflow) {
52+
row.element.classList.remove('hide');
53+
void row.element.offsetLeft; // reflow
54+
} else {
55+
row.element.classList.remove('is-hiding', 'hide');
56+
}
57+
58+
delete row.new;
59+
}
60+
61+
this.clearRows(index);
62+
}
63+
64+
public animate(index: number, previousIndex: number, fromTop = index > previousIndex, ignorePrevious = false) {
65+
if(index === previousIndex) { // * handle if set index 0 and previousIndex 0
66+
return this.setNewRow(index);
67+
}
68+
69+
const row = this.rows[index];
70+
const previousRow = this.rows[previousIndex];
71+
if(!previousRow && !ignorePrevious) {
72+
return this.setNewRow(index);
73+
}
74+
75+
const sides = ['from-top', 'from-bottom'];
76+
if(!fromTop) sides.reverse();
77+
78+
row.element.classList.add(sides[0]);
79+
row.element.classList.remove(sides[1]);
80+
if(previousRow) {
81+
previousRow.element.classList.add(sides[1]);
82+
previousRow.element.classList.remove(sides[0]);
83+
}
84+
85+
if(row.new) {
86+
this.setNewRow(index, true);
87+
}
88+
89+
row.element.classList.toggle('is-hiding', false);
90+
previousRow && previousRow.element.classList.toggle('is-hiding', true);
91+
92+
this.clearRows(index);
93+
}
94+
95+
public destroy() {
96+
for(const i in this.rows) {
97+
this.clearRow(+i);
98+
}
99+
}
100+
}

‎src/components/avatarNew.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,11 @@ export const AvatarNew = (props: {
889889
return ret;
890890
};
891891

892+
export function AvatarNewTsx(props: Parameters<typeof AvatarNew>[0]) {
893+
const el = AvatarNew(props);
894+
return el.element;
895+
}
896+
892897
export function avatarNew(props: {
893898
middleware: Middleware
894899
} & Parameters<typeof AvatarNew>[0]) {

‎src/components/chat/chat.ts

+31-16
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import PopupElement from '../popups';
6565
import PopupStars from '../popups/stars';
6666
import {getPendingPaidReactionKey, PENDING_PAID_REACTIONS} from './reactions';
6767
import tsNow from '../../helpers/tsNow';
68+
import {doubleRaf} from '../../helpers/schedulers.js';
6869

6970
export enum ChatType {
7071
Chat = 'chat',
@@ -1288,9 +1289,17 @@ export default class Chat extends EventListenerBase<{
12881289
const isPaidReaction = options.reaction._ === 'reactionPaid';
12891290
const count = options.count ?? 1;
12901291
if(isPaidReaction) {
1292+
const key = getPendingPaidReactionKey(options.message as Message.message);
1293+
let pending = PENDING_PAID_REACTIONS.get(key);
12911294
if(!this.stars()) {
1295+
let count = 1
1296+
if(pending) {
1297+
count += pending.count();
1298+
pending.abortController.abort();
1299+
}
1300+
12921301
PopupElement.createPopup(PopupStars, {
1293-
itemPrice: 1,
1302+
itemPrice: count,
12941303
onTopup: () => {
12951304
this.sendReaction(options);
12961305
},
@@ -1301,28 +1310,29 @@ export default class Chat extends EventListenerBase<{
13011310
return;
13021311
}
13031312

1304-
const key = getPendingPaidReactionKey(options.message as Message.message);
1305-
let pending = PENDING_PAID_REACTIONS.get(key);
13061313
if(!pending) {
13071314
const [count, setCount] = createSignal(0);
13081315
const [sendTime, setSendTime] = createSignal(0);
1316+
const abortController = new AbortController();
1317+
abortController.signal.addEventListener('abort', () => {
1318+
clearTimeout(pending.sendTimeout);
1319+
pending.setSendTime(0);
1320+
PENDING_PAID_REACTIONS.delete(key);
1321+
setReservedStars((reservedStars) => reservedStars - pending.count());
1322+
rootScope.dispatchEventSingle('messages_reactions', [{
1323+
message: this.getMessageByPeer(options.message.peerId, options.message.mid) as Message.message,
1324+
changedResults: [],
1325+
removedResults: []
1326+
}]);
1327+
});
1328+
13091329
PENDING_PAID_REACTIONS.set(key, pending = {
13101330
count,
13111331
setCount,
13121332
sendTime,
13131333
setSendTime,
13141334
sendTimeout: 0,
1315-
cancel: () => {
1316-
clearTimeout(pending.sendTimeout);
1317-
pending.setSendTime(0);
1318-
PENDING_PAID_REACTIONS.delete(key);
1319-
setReservedStars((reservedStars) => reservedStars - pending.count());
1320-
rootScope.dispatchEventSingle('messages_reactions', [{
1321-
message: this.getMessageByPeer(options.message.peerId, options.message.mid) as Message.message,
1322-
changedResults: [],
1323-
removedResults: []
1324-
}]);
1325-
}
1335+
abortController
13261336
});
13271337
} else {
13281338
clearTimeout(pending.sendTimeout);
@@ -1331,8 +1341,13 @@ export default class Chat extends EventListenerBase<{
13311341
pending.setCount((_count) => _count + count);
13321342
pending.setSendTime(Date.now() + SEND_PAID_REACTION_DELAY);
13331343
pending.sendTimeout = window.setTimeout(() => {
1334-
pending.cancel();
1335-
// alert('yeah');
1344+
const count = pending.count();
1345+
pending.abortController.abort();
1346+
this.managers.appReactionsManager.sendReaction({
1347+
sendAsPeerId: this.getMessageSendingParams().sendAsPeerId,
1348+
...options,
1349+
count
1350+
});
13361351
}, SEND_PAID_REACTION_DELAY);
13371352

13381353
setReservedStars((reservedStars) => reservedStars + count);

‎src/components/chat/contextMenu.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import deepEqual from '../../helpers/object/deepEqual';
7575
import wrapDraftText from '../../lib/richTextProcessor/wrapDraftText';
7676
import flatten from '../../helpers/array/flatten';
7777
import PopupStarReaction from '../popups/starReaction';
78+
import {PENDING_PAID_REACTIONS} from './reactions.js';
7879
import getUniqueCustomEmojisFromMessage from '../../lib/appManagers/utils/messages/getUniqueCustomEmojisFromMessage';
7980

8081
type ChatContextMenuButton = ButtonMenuItemOptions & {
@@ -214,7 +215,8 @@ export default class ChatContextMenu {
214215
}
215216

216217
const paidReactionElement = (e.target as HTMLElement).closest('.reaction.is-paid');
217-
if(paidReactionElement && !findUpClassName(e.target, 'tooltip')) {
218+
if(paidReactionElement) {
219+
PENDING_PAID_REACTIONS.forEach(it => it.abortController.abort());
218220
PopupElement.createPopup(PopupStarReaction, bubble.dataset.peerId.toPeerId(), mid);
219221
return;
220222
}
@@ -1110,6 +1112,12 @@ export default class ChatContextMenu {
11101112
return;
11111113
}
11121114

1115+
if(reaction._ === 'reactionPaid') {
1116+
PENDING_PAID_REACTIONS.forEach(it => it.abortController.abort());
1117+
PopupElement.createPopup(PopupStarReaction, reactionsMessage.peerId, reactionsMessage.mid);
1118+
return;
1119+
}
1120+
11131121
if(!rootScope.premium && tags) {
11141122
PopupPremium.show({feature: 'saved_tags'});
11151123
return;

0 commit comments

Comments
 (0)