Questify: Patch Fix. (#444)

* Fix.

* Make less broad.
This commit is contained in:
Etorix 2025-10-06 17:41:34 -07:00 • committed by GitHub
parent 1c2d573f1d
commit 1b934db3ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1044,7 +1044,7 @@ export default definePlugin({
// Run Questify's sort function every time due to hook requirements but return
// early if not applicable. If the sort method is set to "Questify", replace the
// quests with the sorted ones. Also, setup a trigger to rerender the memo.
match: /(?<=function \i\((\i).{0,100}?useRef\(0\);)(return \i.useMemo\(\(\)=>{)/,
match: /(?<=function \i\((\i),\i,\i\){let \i=\i.useRef.{0,100}?;)(return \i.useMemo\(\(\)=>{)/,
replace: "const questRerenderTrigger=$self.useQuestRerender();const questifySorted=$self.sortQuests($1,arguments[1].sortMethod!==\"questify\");$2if(arguments[1].sortMethod===\"questify\"){$1=questifySorted;};"
},
{
@ -1059,7 +1059,7 @@ export default definePlugin({
},
{
// Add the trigger to the memo for rerendering Quests order due to progress changes, etc.
match: /(?<=current=\i\.length,\i},\[\i,\i,\i)/,
match: /(?<=id\);.{0,100}?,\i},\[\i,\i,\i)/,
replace: ",questRerenderTrigger,questifySorted"
}
]