FakeProfileThemesAndEffects: fix plugin unable to enable at all
This commit is contained in:
parent
9bac8d6953
commit
648d05f6b2
1 changed files with 12 additions and 1 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import { chunk } from "lodash";
|
||||
import React, { type ReactNode, useContext, useMemo, useState } from "react";
|
||||
import { View, type ViewStyle } from "react-native";
|
||||
|
||||
|
|
@ -12,6 +11,18 @@ import { Radius, SafeAreaContext, Spacing, useWindowDimensions } from "@fpte/ui/
|
|||
|
||||
const ROW_SIZE = 3;
|
||||
|
||||
// lodash isn't a dependency of this repo (no node_modules/lodash, nothing in package.json) - the
|
||||
// build's Rollup config only marks react/react-native external, so an unresolved "lodash" import
|
||||
// got emitted as a bare, undefined global reference in the compiled bundle. That threw
|
||||
// "ReferenceError: lodash is not defined" the instant Revenge evaluated this plugin's bundle,
|
||||
// before onLoad ever ran - which is why enabling the plugin silently reverted with no visible
|
||||
// error anywhere. Only one function was ever used from it, so it's inlined here instead.
|
||||
function chunk<T>(arr: T[], size: number): T[][] {
|
||||
const result: T[][] = [];
|
||||
for (let i = 0; i < arr.length; i += size) result.push(arr.slice(i, i + size));
|
||||
return result;
|
||||
}
|
||||
|
||||
interface ItemProps {
|
||||
label: string;
|
||||
isSelected: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue