Skip to content

Commit

Permalink
Fallback + Fix
Browse files Browse the repository at this point in the history
Fallback: If theme fails to apply, reopening the player will apply it
Fix: Check if it's the right site first...
  • Loading branch information
vampiricwulf committed Apr 8, 2024
1 parent ac09b45 commit ad587bc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/4chan-sounds-player.meta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan sounds player
// @version 3.5.3
// @version 3.5.4
// @namespace rccom
// @description A player designed for 4chan sounds threads.
// @author RCC
Expand Down
4 changes: 2 additions & 2 deletions dist/4chan-sounds-player.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "4chan-sounds-player",
"version": "3.5.3",
"version": "3.5.4",
"description": "Play that faggy music weeb boi",
"main": "main.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/components/display/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ module.exports = {
*/
toggle() {
if (Player.container.style.display === 'none') {
Player.theme.applyBoardTheme();
Player.show();
} else {
Player.hide();
Expand Down
2 changes: 1 addition & 1 deletion src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ window.ns = 'fcsp';

window.is4chan = location.hostname.includes('4chan.org') || location.hostname.includes('4channel.org');
window.isChanX = document.documentElement && document.documentElement.classList.contains('fourchan-x');
window.isOneechan = document.documentElement && document.documentElement.classList.contains('oneechan');
window.isOneeChan = document.documentElement && document.documentElement.classList.contains('oneechan');
window.Board = location.pathname.split('/')[1];
window.Thread = (location.href.match(/\/thread\/(\d+)/) || [])[1];

Expand Down
10 changes: 5 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ async function doInit() {
subtree: true
});

if (isOneechan) {
waitingForOneechan();
}
if (is4chan)
if (isOneeChan)
waitingForOneeChan();
}

function waitingForOneechan () {
function waitingForOneeChan () {
if(!document.querySelector('#OneeChanLink')) {
window.setTimeout(waitingForOneechan,50);
window.setTimeout(waitingForOneeChan,50);
} else {
Player.theme.applyBoardTheme();
}
Expand Down

0 comments on commit ad587bc

Please sign in to comment.