From 6e250c689ea312fc757385c9cbccd7bf5b2df81a Mon Sep 17 00:00:00 2001 From: ririxi Date: Sat, 7 Sep 2024 21:24:08 +0200 Subject: [PATCH] feat: remove support for pre-Library X UI --- jsHelper/spicetifyWrapper.js | 29 ++--------------------------- src/apply/apply.go | 14 -------------- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/jsHelper/spicetifyWrapper.js b/jsHelper/spicetifyWrapper.js index 50b9d8ffde..b0d3687e37 100644 --- a/jsHelper/spicetifyWrapper.js +++ b/jsHelper/spicetifyWrapper.js @@ -1853,7 +1853,7 @@ Spicetify.ContextMenu = (() => { let navLinkFactoryCtx = null; let refreshNavLinks = null; -Spicetify._renderNavLinks = (list, isTouchScreenUi, isPreLibX = false) => { +Spicetify._renderNavLinks = (list, isTouchScreenUi) => { const [refreshCount, refresh] = Spicetify.React.useReducer((x) => x + 1, 0); refreshNavLinks = refresh; @@ -1866,7 +1866,7 @@ Spicetify._renderNavLinks = (list, isTouchScreenUi, isPreLibX = false) => { ) return; - const navLinkFactory = isTouchScreenUi ? NavLinkGlobal : isPreLibX ? NavLinkSidebarLegacy : NavLinkSidebar; + const navLinkFactory = isTouchScreenUi ? NavLinkGlobal : NavLinkSidebar; if (!navLinkFactoryCtx) navLinkFactoryCtx = Spicetify.React.createContext(null); const registered = []; @@ -1951,31 +1951,6 @@ const NavLink = ({ appProper, appRoutePath, icon, activeIcon }) => { return NavLinkFactory && Spicetify.React.createElement(NavLinkFactory, { appProper, appRoutePath, createIcon, isActive }, null); }; -const NavLinkSidebarLegacy = ({ appProper, appRoutePath, createIcon, isActive }) => { - return Spicetify.React.createElement( - "li", - { className: "main-navBar-navBarItem InvalidDropTarget" }, - Spicetify.React.createElement( - Spicetify.ReactComponent.TooltipWrapper, - { label: appProper, placement: "right" }, - Spicetify.React.createElement( - Spicetify.ReactComponent.Navigation, - { - to: appRoutePath, - referrer: "other", - className: Spicetify.classnames("link-subtle", "main-navBar-navBarLink", { - "main-navBar-navBarLinkActive active": isActive, - }), - onClick: () => undefined, - "aria-label": appProper, - }, - createIcon(), - Spicetify.React.createElement(Spicetify.ReactComponent.TextComponent, { variant: "mestoBold" }, appProper) - ) - ) - ); -}; - const NavLinkSidebar = ({ appProper, appRoutePath, createIcon, isActive }) => { const isSidebarCollapsed = Spicetify.Platform.LocalStorageAPI.getItem("ylx-sidebar-state") === 1; diff --git a/src/apply/apply.go b/src/apply/apply.go index 47f13465db..5be5a4c827 100644 --- a/src/apply/apply.go +++ b/src/apply/apply.go @@ -335,20 +335,6 @@ func insertNavLink(str string, appNameArray string) string { 1) } - // pre-Library X - sidebarItemMatch := utils.SeekToCloseParen( - str, - `\("li",\{className:[\w$\.]+\}?,(?:children:)?[\w$\.,()]+\(\w+,\{uri:"spotify:user:@:collection",to:"/collection"`, - '(', ')') - - if sidebarItemMatch != "" { - str = strings.Replace( - str, - sidebarItemMatch, - fmt.Sprintf("%s,Spicetify._renderNavLinks([%s], false, true)", sidebarItemMatch, appNameArray), - 1) - } - // Global Navbar utils.ReplaceOnce(&str, `(,[a-zA-Z_\$][\w\$]*===(?:[a-zA-Z_\$][\w\$]*\.){2}HOME_NEXT_TO_NAVIGATION&&.+?)\]`, func(submatches ...string) string { return fmt.Sprintf("%s,Spicetify._renderNavLinks([%s], true)]", submatches[1], appNameArray)