Skip to content

Commit

Permalink
AvatarSettingsButton - fix popout hiding on settings open
Browse files Browse the repository at this point in the history
  • Loading branch information
Neodymium7 committed Dec 10, 2024
1 parent f504466 commit ad32e3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions AvatarSettingsButton/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ export default class AvatarSettingsButton extends BasePlugin {

openSettings() {
UserSettingsWindow.setSection(Sections.ACCOUNT);
if (document.querySelector(`.${accountClasses.accountProfilePopoutWrapper}`)) this.openPopout();
UserSettingsWindow.open();
if (document.querySelector("#status-picker") || document.querySelector("#account")) this.openPopout();
}

openContextMenu(e: MouseEvent) {
if (document.querySelector(`.${accountClasses.accountProfilePopoutWrapper}`)) this.openPopout();
document.querySelector(settingsSelector).dispatchEvent(
new MouseEvent("contextmenu", {
bubbles: true,
clientX: e.clientX,
clientY: screen.height - 12,
})
);
if (document.querySelector("#status-picker") || document.querySelector("#account")) this.openPopout();
}

addListeners() {
Expand Down
4 changes: 2 additions & 2 deletions AvatarSettingsButton/src/modules/discordmodules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
interface AccountClasses {
container: string;
avatarWrapper: string;
withTagAsButton: string;
accountProfilePopoutWrapper: string;
}

const Error = (_props) => (
Expand Down Expand Up @@ -42,7 +42,7 @@ export const Sections = expectModule({
fallback: { ACCOUNT: "My Account" },
});

export const accountClasses = expectModule<AccountClasses>(byKeys("buildOverrideButton"), {
export const accountClasses = expectModule<AccountClasses>(byKeys("accountProfilePopoutWrapper"), {
name: "Account Classes",
fatal: true,
});
Expand Down

0 comments on commit ad32e3b

Please sign in to comment.