Skip to content

Commit

Permalink
fix(apply): backwards compatibility (spicetify#1829)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrie25 authored Jul 21, 2022
1 parent ba5cef8 commit 487dc70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func insertCustomApp(jsPath string, flags Flag) {

utils.Replace(
&content,
`[\w()]+\.createElement\("li",\{className:[\w$\.]+\},[\w()]+\.createElement\(\w+,\{uri:"spotify:user:@:collection",to:"/collection",onDrop:\w+,onNavigate:\w+\}`,
`[\w()]+\.createElement\("li",\{className:[\w$\.]+\},[\w()]+\.createElement\(\w+,\{uri:"spotify:user:@:collection",to:"/collection"(,onDrop:\w+,onNavigate:\w+)?\}`,
`Spicetify._sidebarItemToClone=${0}`)

utils.ReplaceOnce(
Expand All @@ -255,7 +255,7 @@ func insertCustomApp(jsPath string, flags Flag) {

sidebarItemMatch := utils.SeekToCloseParen(
content,
`\("li",\{className:[\w$\.]+\},[\w()]+\.createElement\(\w+,\{uri:"spotify:user:@:collection",to:"/collection",onDrop:\w+,onNavigate:\w+\}`,
`\("li",\{className:[\w$\.]+\},[\w()]+\.createElement\(\w+,\{uri:"spotify:user:@:collection",to:"/collection"(,onDrop:\w+,onNavigate:\w+)?\}`,
'(', ')')

content = strings.Replace(
Expand Down

0 comments on commit 487dc70

Please sign in to comment.