Skip to content

Commit

Permalink
Refactor theme.script.js to conditionally apply UI changes based on S…
Browse files Browse the repository at this point in the history
…picetify platform version and the presence of global navigation
  • Loading branch information
ohitstom committed Sep 25, 2024
1 parent ec7163d commit 22095d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Comfy/theme.script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,10 @@ todo:
name: "Topbar-Inside-Titlebar-Snippet",
title: "Move Topbar Inside Titlebar",
defaultVal: false,
condition: Spicetify.Platform.version <= "1.2.46.462" && !document.querySelector(":root .global-nav"),
callback: value => {
if (document.querySelector(":root .global-nav")) return;

waitForDeps(
[".Root__top-container", ".main-topBar-container"],
elements => {
Expand Down Expand Up @@ -1151,7 +1154,8 @@ todo:
type: Toggle,
name: "Horizontal-pageLinks-Snippet",
title: "Horizontal Page Links",
defaultVal: false
defaultVal: false,
condition: Spicetify.Platform.version <= "1.2.46.462" && !document.querySelector(":root .global-nav")
}
]),
Spicetify.React.createElement(Section, { name: "Tracklist", filter }, [
Expand Down Expand Up @@ -1246,6 +1250,7 @@ todo:
title: "Above Right Panel",
desc: "Moves the playbar above the right panel",
defaultVal: false,
condition: Spicetify.Platform.version <= "1.2.46.462" && !document.querySelector(":root .global-nav"),
callback: value => {
waitForDeps(
".Root__top-container",
Expand Down

0 comments on commit 22095d4

Please sign in to comment.