Experiments: Fix client crash with new experiment embed

This commit is contained in:
Nuckyz 2025-05-03 08:53:58 -03:00
parent 15fa0ff7a7
commit 578aa5f107
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -109,10 +109,17 @@ export default definePlugin({
// Enable experiment embed on sent experiment links
{
find: "dev://experiment/",
replacement: {
match: /\i\.isStaff\(\)/,
replace: "true"
}
replacement: [
{
match: /\i\.isStaff\(\)/,
replace: "true"
},
// Fix some tricky experiments name causing a client crash
{
match: /.getRegisteredExperiments\(\)(?<=(\i)=.+?).+?if\(null==(\i)(?=\)return null;)/,
replace: "$&||!Object.hasOwn($1,$2)"
}
]
},
],