Skip to content

Commit 04c6800

Browse files
committed
Toast Notification Bug Fix
1 parent 870d62e commit 04c6800

4 files changed

Lines changed: 73 additions & 72 deletions

File tree

chat.html

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/simple-notify.min.css">
1414
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/animate.min.css">
1515

16-
<link rel="stylesheet" href="css/chatrd.css?nocache=28">
16+
<link rel="stylesheet" href="css/chatrd.css?nocache=29">
1717
<link id="chatrd-skins" rel="stylesheet" href="css/skin-default.css">
1818
</head>
1919
<body>
@@ -170,42 +170,42 @@
170170
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/purify.min.js"></script>
171171
<script src="https://cdn.jsdelivr.net/npm/@streamerbot/[email protected]/dist/streamerbot-client.min.js"></script>
172172

173-
<script src="js/i18n-chatrd.js?nocache=28"></script>
173+
<script src="js/i18n-chatrd.js?nocache=29"></script>
174174

175-
<script src="js/speakerbot.js?nocache=28"></script>
176-
<script src="js/sb.js?nocache=28"></script>
175+
<script src="js/speakerbot.js?nocache=29"></script>
176+
<script src="js/sb.js?nocache=29"></script>
177177

178-
<script src="js/chatrd.js?nocache=28"></script>
178+
<script src="js/chatrd.js?nocache=29"></script>
179179

180-
<link href="js/modules/twitch/module.css?nocache=28" rel="stylesheet">
181-
<script src="js/modules/twitch/module.js?nocache=28"></script>
180+
<link href="js/modules/twitch/module.css?nocache=29" rel="stylesheet">
181+
<script src="js/modules/twitch/module.js?nocache=29"></script>
182182

183-
<link href="js/modules/youtube/module.css?nocache=28" rel="stylesheet">
184-
<script src="js/modules/youtube/module.js?nocache=28"></script>
183+
<link href="js/modules/youtube/module.css?nocache=29" rel="stylesheet">
184+
<script src="js/modules/youtube/module.js?nocache=29"></script>
185185

186-
<link href="js/modules/tiktok/module.css?nocache=28" rel="stylesheet">
187-
<script src="js/modules/tiktok/module.js?nocache=28"></script>
186+
<link href="js/modules/tiktok/module.css?nocache=29" rel="stylesheet">
187+
<script src="js/modules/tiktok/module.js?nocache=29"></script>
188188

189-
<link href="js/modules/kick/module.css?nocache=28" rel="stylesheet">
190-
<script src="js/modules/kick/module.js?nocache=28"></script>
189+
<link href="js/modules/kick/module.css?nocache=29" rel="stylesheet">
190+
<script src="js/modules/kick/module.js?nocache=29"></script>
191191

192-
<link href="js/modules/streamelements/module.css?nocache=28" rel="stylesheet">
193-
<script src="js/modules/streamelements/module.js?nocache=28"></script>
192+
<link href="js/modules/streamelements/module.css?nocache=29" rel="stylesheet">
193+
<script src="js/modules/streamelements/module.js?nocache=29"></script>
194194

195-
<link href="js/modules/streamlabs/module.css?nocache=28" rel="stylesheet">
196-
<script src="js/modules/streamlabs/module.js?nocache=28"></script>
195+
<link href="js/modules/streamlabs/module.css?nocache=29" rel="stylesheet">
196+
<script src="js/modules/streamlabs/module.js?nocache=29"></script>
197197

198-
<link href="js/modules/patreon/module.css?nocache=28" rel="stylesheet">
199-
<script src="js/modules/patreon/module.js?nocache=28"></script>
198+
<link href="js/modules/patreon/module.css?nocache=29" rel="stylesheet">
199+
<script src="js/modules/patreon/module.js?nocache=29"></script>
200200

201-
<link href="js/modules/tipeeestream/module.css?nocache=28" rel="stylesheet">
202-
<script src="js/modules/tipeeestream/module.js?nocache=28"></script>
201+
<link href="js/modules/tipeeestream/module.css?nocache=29" rel="stylesheet">
202+
<script src="js/modules/tipeeestream/module.js?nocache=29"></script>
203203

204-
<link href="js/modules/kofi/module.css?nocache=28" rel="stylesheet">
205-
<script src="js/modules/kofi/module.js?nocache=28"></script>
204+
<link href="js/modules/kofi/module.css?nocache=29" rel="stylesheet">
205+
<script src="js/modules/kofi/module.js?nocache=29"></script>
206206

207-
<link href="js/modules/fourthwall/module.css?nocache=28" rel="stylesheet">
208-
<script src="js/modules/fourthwall/module.js?nocache=28"></script>
207+
<link href="js/modules/fourthwall/module.css?nocache=29" rel="stylesheet">
208+
<script src="js/modules/fourthwall/module.js?nocache=29"></script>
209209

210210
</body>
211211
</html>

js/chatrd.js

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ function addMessageItem(platform, clone, classes, userid, messageid) {
180180
lastClasses = lastClasses.join(' ');
181181

182182
let currentClasses = Array.from(classes)
183-
//.filter(c => c !== 'streamer-mentioned')
184183
.join(' ');
185184

186185
if (lastUserId == userid && lastClasses == currentClasses) {
@@ -483,51 +482,7 @@ function formatSubMonthDuration(months) {
483482
}
484483

485484

486-
const pushNotify = (data) => {
487-
488-
const SimpleNotify = {
489-
effect: 'fade',
490-
speed: 500,
491-
customClass: 'toasty',
492-
customIcon: '',
493-
showIcon: true,
494-
showCloseButton: true,
495-
autoclose: true,
496-
autotimeout: 2500,
497-
notificationsGap: null,
498-
notificationsPadding: null,
499-
type: 'outline',
500-
position: 'x-center bottom',
501-
customWrapper: '',
502-
};
503-
const mergedData = {
504-
...SimpleNotify,
505-
...data
506-
}
507-
new Notify (mergedData);
508-
509-
}
510-
511-
const notifyError = (err) => {
512-
err.status = 'error';
513-
pushNotify(err);
514-
}
515485

516-
const notifyInfo = (info) => {
517-
info.status = 'info';
518-
pushNotify(info);
519-
}
520-
521-
const notifyWarning = (warn) => {
522-
warn.status = 'warning';
523-
pushNotify(warn);
524-
}
525-
526-
527-
const notifySuccess = (success) => {
528-
success.status = 'success';
529-
pushNotify(success);
530-
}
531486

532487

533488
function animateCounter(element, start, end, duration) {

js/modules/kick/module.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ async function kickConnection() {
8989

9090

9191
const kickMaxTries = 20;
92-
const kickReconnectDelay = 10000;
92+
const kickReconnectDelay = 5000;
9393
let retryCount = 0;
94-
9594

9695

9796
async function connect() {

js/sb.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,50 @@ function registerPlatformHandlersToStreamerBot(handlers, logPrefix = '') {
9595
});
9696
}
9797
}
98+
99+
100+
const pushNotify = (data) => {
101+
102+
const SimpleNotify = {
103+
effect: 'fade',
104+
speed: 500,
105+
customClass: 'toasty',
106+
customIcon: '',
107+
showIcon: true,
108+
showCloseButton: true,
109+
autoclose: true,
110+
autotimeout: 2500,
111+
notificationsGap: null,
112+
notificationsPadding: null,
113+
type: 'outline',
114+
position: 'x-center bottom',
115+
customWrapper: '',
116+
};
117+
const mergedData = {
118+
...SimpleNotify,
119+
...data
120+
}
121+
new Notify (mergedData);
122+
123+
}
124+
125+
const notifyError = (err) => {
126+
err.status = 'error';
127+
pushNotify(err);
128+
}
129+
130+
const notifyInfo = (info) => {
131+
info.status = 'info';
132+
pushNotify(info);
133+
}
134+
135+
const notifyWarning = (warn) => {
136+
warn.status = 'warning';
137+
pushNotify(warn);
138+
}
139+
140+
141+
const notifySuccess = (success) => {
142+
success.status = 'success';
143+
pushNotify(success);
144+
}

0 commit comments

Comments
 (0)