Skip to content

Commit 096f949

Browse files
committed
- Fixed Bonus Button Blunder issue
1 parent 2a36dc3 commit 096f949

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
----
8080

8181
# DONE — Notable Changes
82+
> [`5.33.4.21`](https://github.com/Ephellon/Twitch-Tools/releases/tag/5.33.4.21)
83+
- Fixed Bonus Button Blunder issue
84+
8285
> [`5.33.4.20`](https://github.com/Ephellon/Twitch-Tools/releases/tag/5.33.4.20)
8386
- Fixed drops logic
8487
- Fixed `class Recording` logic

ttv-tools.zip

238 Bytes
Binary file not shown.

ttv-tools/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "TTV Tools",
55
"description": "Adds extra features to Twitch",
66

7-
"version": "5.33.4.20",
7+
"version": "5.33.4.21",
88
"minimum_chrome_version": "88",
99
"homepage_url": "https://github.com/ephellon/twitch-tools",
1010

ttv-tools/tools.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ when(() => top.TWITCH_INTEGRITY_FAIL, 5_000).then(() => {
107107
});
108108
});
109109

110+
// Twith's "bonus button blunder" issue...
111+
// If the bonus button is present before the extension finishes loading, the display completely breaks...
112+
BONUS_BUTTON_BLUNDER: {
113+
when.defined(() => null
114+
?? $.last('[class*="bonus"i]')?.closest('button')
115+
?? $.last('[data-test-selector*="points"i][data-test-selector*="summary"i] button[class*="success"i]')
116+
?? $.last('[data-test-selector*="points"i][data-test-selector*="summary"i] button:is([class*="destruct"i], [class*="error"i])')
117+
?? $.last('[class*="points"i] button [class*="bonus"i]')?.closest('button')
118+
).then(ChannelPointsButton => ChannelPointsButton.click());
119+
}
120+
110121
/*** Setup (pre-init) - #MARK:classes #MARK:functions #MARK:methods
111122
* _____ _ __ _ _ _ __
112123
* / ____| | | / / (_) (_) |\ \
@@ -131,11 +142,14 @@ class Balloon {
131142
constructor({ title, icon = 'play', iconAttr = {} }, ...jobs) {
132143
let f = furnish;
133144

134-
let [L_pane, C_pane, R_pane] = $.all('.top-nav__menu > div'),
145+
let [L_pane, C_pane, R_pane] = $.all('.top-nav__menu > div:not(:only-child)'),
135146
X = $('#tt-balloon', R_pane),
136147
I = Runtime.getURL('profile.png'),
137148
F, C, H, U, N;
138149

150+
if([L_pane, C_pane, R_pane].filter(nullish).length)
151+
return;
152+
139153
let uuid = U = UUID.from([title, JSON.stringify(jobs)].join(':')).value,
140154
existing = Balloon.#BALLOONS.get(title);
141155

@@ -443,7 +457,7 @@ class Balloon {
443457
)
444458
);
445459

446-
R_pane?.insertBefore(p, R_pane.children[1]);
460+
R_pane?.insertBefore(p, R_pane.firstElementChild);
447461

448462
this.body = C;
449463
this.icon = N;

0 commit comments

Comments
 (0)