Skip to content

Commit

Permalink
v3.3.2: minor fixes from Discord update
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickxchong committed Nov 11, 2022
1 parent a2f65a5 commit 0b65333
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/hide-discord-sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ body.hide-dis-bar .noticeInfo-3_iTE1,
z-index: 1000;
}

body.hide-dis-bar .toolbar-1t6TWx {
body.hide-dis-bar div[class*="toolbar-"] {
padding-right: 100px;
}

Expand Down
11 changes: 7 additions & 4 deletions src/hide-discord-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ const HDS = {
}
this.resizeHandler();
},
init() {
getServers() {
// Select the server list element, which changes in some updates.
const guildsWrapper = document.getElementsByClassName('guildsWrapper-5TJh6A')[0]
|| document.getElementsByClassName('wrapper-1Rf91z')[0]
|| document.getElementsByClassName('wrapper-3NnKdC')[0]
// General fallback to select the server list.
|| document.querySelector("nav[class*=wrapper-]");
return guildsWrapper;
},
init() {
const guildsWrapper = this.getServers();

if (!guildsWrapper) {
// console.log("not a discord chat page");
Expand All @@ -47,7 +51,6 @@ const HDS = {
};
document.body.appendChild(btn);

this.$refs.guildsWrapper = guildsWrapper;
this.$refs.btn = btn;

let timeout = false; // holder for timeout id
Expand Down Expand Up @@ -90,7 +93,7 @@ const HDS = {
},

hideServers(updateBackend = true) {
this.$refs.guildsWrapper.style.display = 'none';
this.getServers().style.display = 'none';
this.$refs.btn.innerHTML = "Show Servers";
if (updateBackend) {
this.state.showServers = false;
Expand All @@ -99,7 +102,7 @@ const HDS = {
},

showServers(updateBackend = true) {
this.$refs.guildsWrapper.style.display = 'flex';
this.getServers().style.display = 'flex';
this.$refs.btn.innerHTML = "Hide Servers";
if (updateBackend) {
this.state.showServers = true;
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Hide Discord Sidebar",
"short_name": "Hide Dis Bar",
"version": "3.3.0",
"version": "3.3.2",
"description": "Hide Discord Servers and Channels! Installs a button that hides/shows the Discord server list and autohides the channels list.",
"manifest_version": 2,
"icons": {
Expand Down

0 comments on commit 0b65333

Please sign in to comment.