FakeProfileThemesAndEffects: default to the safe fallback effect picker
This commit is contained in:
parent
648d05f6b2
commit
f4c4664feb
1 changed files with 11 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import { logger } from "@vendetta";
|
import { logger } from "@vendetta";
|
||||||
|
import { storage } from "@vendetta/plugin";
|
||||||
import { applyPatches } from "@shared/lib/patcher";
|
import { applyPatches } from "@shared/lib/patcher";
|
||||||
import { FluxDispatcher } from "@fpte/lib/flux";
|
import { FluxDispatcher } from "@fpte/lib/flux";
|
||||||
import { UserProfileStore, UserStore } from "@fpte/lib/stores";
|
import { UserProfileStore, UserStore } from "@fpte/lib/stores";
|
||||||
|
|
@ -30,6 +31,16 @@ let unpatchAll: () => void = () => {};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
// The "real" picker (EffectPickerActionSheet.tsx) works by manually calling Discord's own
|
||||||
|
// EditProfileEffectActionSheet as a plain function from inside this plugin's own render,
|
||||||
|
// outside React's normal reconciliation - Discord's component's hooks end up chained onto
|
||||||
|
// this fiber's hook list. If that component's own hook count/order ever varies, that's the
|
||||||
|
// "Rendered more/fewer hooks" crash class, and it's the one this plugin's own settings
|
||||||
|
// screen already had a manual override toggle for. Defaulting to the fallback picker (a
|
||||||
|
// self-contained implementation using only its own hooks) instead of opting into that risk
|
||||||
|
// by default - it's a real crash a user hit live opening the Effects picker.
|
||||||
|
storage.forceFallbackEffectPicker ??= true;
|
||||||
|
|
||||||
unpatchAll = applyPatches("FakeProfileThemesAndEffects", logger, {
|
unpatchAll = applyPatches("FakeProfileThemesAndEffects", logger, {
|
||||||
"purchase check": patchGetPurchase,
|
"purchase check": patchGetPurchase,
|
||||||
"user profile data": patchGetUserProfile,
|
"user profile data": patchGetUserProfile,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue