Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[Source/Utils] Revert modal position
Browse files Browse the repository at this point in the history
  • Loading branch information
Socketlike committed Feb 28, 2023
1 parent b7d3887 commit 16b4207
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,5 @@

.spotify-modal > .divider {
background-color: var(--background-modifier-accent);
height: 3px;
height: 1px;
}
8 changes: 3 additions & 5 deletions src/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,10 @@ export function isModalInjected(): boolean {
export function addRootInPanel(): void {
if (!panelExists() || isModalInjected()) return;

const panelContainer = document.body.querySelectorAll(
'[class^="panels-"] > [class^="container-"]',
)?.[0];
if (!panelContainer) return;
const panels = document.body.querySelectorAll('[class^="panels-"]')?.[0];
if (!panels) return;

panelContainer.insertAdjacentElement('beforebegin', root.element);
panels.insertAdjacentElement('afterbegin', root.element);

if (config.get('debuggingLogModalInjection', defaultConfig.debuggingLogModalInjection))
logger.log('Modal injected w/ DOM');
Expand Down

0 comments on commit 16b4207

Please sign in to comment.