Experiments(isStaff): Fix search history not showing

This commit is contained in:
Vendicated 2023-10-07 23:00:44 +02:00
parent c0f2c97458
commit ac1b67ccbd
No known key found for this signature in database
GPG Key ID: D66986BAF75ECF18

View File

@ -33,12 +33,6 @@ const settings = definePluginSettings({
type: OptionType.BOOLEAN,
default: false,
restartNeeded: true
},
forceStagingBanner: {
description: "Whether to force Staging banner under user area.",
type: OptionType.BOOLEAN,
default: false,
restartNeeded: true
}
});
@ -83,12 +77,13 @@ export default definePlugin({
}
]
},
// Fix search history being disabled / broken with isStaff
{
find: ".Messages.DEV_NOTICE_STAGING",
predicate: () => settings.store.forceStagingBanner,
find: 'get("disable_new_search")',
predicate: () => settings.store.enableIsStaff,
replacement: {
match: /"staging"===window\.GLOBAL_ENV\.RELEASE_CHANNEL/,
replace: "true"
match: /(?<=showNewSearch"\);return)\s?!/,
replace: "!1&&!"
}
},
{