Skip to content

Commit

Permalink
fix(wrapper): fix ContextMenu regex for v1.2.13 (spicetify#2810)
Browse files Browse the repository at this point in the history
  • Loading branch information
Delusoire authored Feb 9, 2024
1 parent 771c136 commit e5449ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/preprocess/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func exposeAPIs_main(input string) string {
trigger := utils.FindLastMatch(croppedInput, `trigger:([\w_$]+)`)[1]
target := utils.FindLastMatch(croppedInput, `triggerRef:([\w_$]+)`)[1]

utils.Replace(&input, `\(0,([\w_$]+)\.jsx\)\([\w_$]+\.[\w_$]+,\{value:"contextmenu"[^\}]+\}\)\}\)`, `${1}.jsx((Spicetify.ContextMenuV2._context||(Spicetify.ContextMenuV2._context=`+react+`.createContext(null))).Provider,{value:{props:`+menu+`?.props,trigger:`+trigger+`,target:`+target+`},children:${0}})`)
utils.Replace(&input, `\(0,([\w_$]+)\.jsx\)\([\w_$]+\.[\w_$]+,\{value:"contextmenu"[^\}]+\}\)\}\)`, `(0,${1}.jsx)((Spicetify.ContextMenuV2._context||(Spicetify.ContextMenuV2._context=`+react+`.createContext(null))).Provider,{value:{props:`+menu+`?.props,trigger:`+trigger+`,target:`+target+`},children:${0}})`)

return input
}
Expand Down

0 comments on commit e5449ca

Please sign in to comment.