Skip to content

Commit

Permalink
Hide casual vote button when casual mode is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Feb 7, 2025
1 parent e369473 commit b41e211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/submission/casualVoteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,12 @@ export class CasualVoteButton extends TitleButton {
}

updateIcon(): void {
if (Config.config!.extensionEnabled) {
if (this.container) {
this.container.style.removeProperty("display");
}
if (Config.config!.extensionEnabled && Config.config!.casualMode) {
this.button.style.removeProperty("display");

super.updateIcon();
} else {
if (this.container) {
this.container.style.display = "none";
}
this.button.style.display = "none";
}
}
}
3 changes: 3 additions & 0 deletions src/videoBranding/videoBranding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ export function setupOptionChangeListener(): void {

const settingsToReload = [
"extensionEnabled",
"casualMode",
"replaceTitles",
"replaceThumbnails",
"useCrowdsourcedTitles",
Expand Down Expand Up @@ -526,6 +527,8 @@ export function setupOptionChangeListener(): void {
if (changes["extensionEnabled"]) {
submitButton.updateIcon();
casualVoteButton.updateIcon();
} else if (changes["casualMode"]) {
casualVoteButton.updateIcon();
}
}

Expand Down

0 comments on commit b41e211

Please sign in to comment.