From 487dc7038c6c638ca92cb10a9b17eeb7ee30cd74 Mon Sep 17 00:00:00 2001 From: Nam Anh Date: Thu, 21 Jul 2022 20:27:46 +0700 Subject: [PATCH] fix(apply): backwards compatibility (#1829) --- src/apply/apply.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apply/apply.go b/src/apply/apply.go index df4cc95f2a..7ddad4470c 100644 --- a/src/apply/apply.go +++ b/src/apply/apply.go @@ -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( @@ -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(