Skip to content

Commit c5b53c0

Browse files
committed
Merge branch 'release/1.2.2'
2 parents 0331b49 + 914e7da commit c5b53c0

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "twitch-auto-points",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Automatic twitch bonus point collection",
55
"main": "index.js",
66
"scripts": {

src/background/browserAction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ browser.tabs.onRemoved.addListener((tabId) => {
185185
const onContentScriptMessage = async (message, sender) => {
186186
if (sender.id === browser.runtime.id) {
187187
if (message.type === 'add_points') {
188-
const channelId = new URL(sender.url).pathname.split('/').pop();
188+
const channelId = message.channelId;
189189
const pointsCollectedForChannel = extension.getChannelPoints(channelId);
190190
const updatedAmount = pointsCollectedForChannel + message.bonus;
191191
extension.setChannelPoints(channelId, updatedAmount);

src/contentScripts/worker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ function tryToGetReceivedPoints() {
5757
if (bonusAmount) {
5858
// slice to remove + at the beginning
5959
const bonusAmountInt = parseInt(bonusAmount.slice(1), 10);
60+
const channelId = document.querySelector('.tw-halo')?.getAttribute('href').split('/').pop();
6061
browser.runtime.sendMessage({
6162
type: 'add_points',
62-
bonus: bonusAmountInt
63+
bonus: bonusAmountInt,
64+
channelId
6365
});
6466

6567
clearInterval(pointsInterval);

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 2,
33
"author": "Daniyil Vasylenko",
44
"name": "Twitch Auto Points",
5-
"version": "1.2.1",
5+
"version": "1.2.2",
66
"homepage_url": "https://github.com/Spring3/twitch-auto-points",
77
"description": "Automatic twitch channel points collection",
88
"permissions": [

0 commit comments

Comments
 (0)