Skip to content

Commit

Permalink
fix(apply): remove 4th submatch since it's unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
rxri committed Sep 8, 2024
1 parent 4e947ad commit c0bb5d8
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 @@ -338,8 +338,8 @@ func insertNavLink(str string, appNameArray string) string {
})

// Global Navbar >= 1.2.46
utils.ReplaceOnce(&str, `("global-nav-bar".*?)(\(0,\s*[a-zA-Z_\$][\w\$]*\.jsx\))(\(\s*\w+,\s*\{\s*className:\w*\s*\}\s*\))\s*\}\),\s*(\(0,)`, func(submatches ...string) string {
return fmt.Sprintf("%s[%s%s,Spicetify._renderNavLinks([%s], true)].flat()}),%s", submatches[1], submatches[2], submatches[3], appNameArray, submatches[4])
utils.ReplaceOnce(&str, `("global-nav-bar".*?)(\(0,\s*[a-zA-Z_\$][\w\$]*\.jsx\))(\(\s*\w+,\s*\{\s*className:\w*\s*\}\s*\))`, func(submatches ...string) string {
return fmt.Sprintf("%s[%s%s,Spicetify._renderNavLinks([%s], true)].flat()", submatches[1], submatches[2], submatches[3], appNameArray)
})

return str
Expand Down

0 comments on commit c0bb5d8

Please sign in to comment.