mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 15:35:11 +00:00
fixes
This commit is contained in:
parent
567127ff45
commit
c141b8e884
2 changed files with 20 additions and 20 deletions
|
@ -72,15 +72,13 @@ export function SettingArrayComponent({
|
||||||
const [text, setText] = useState<string>("");
|
const [text, setText] = useState<string>("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (text === "") {
|
if (!isNaN(Number(text)) && text !== "") {
|
||||||
setError(null);
|
|
||||||
} else if (!isNaN(Number(text))) {
|
|
||||||
if (text.length >= 18 && text.length <= 19) {
|
if (text.length >= 18 && text.length <= 19) {
|
||||||
setError(null);
|
setError(null);
|
||||||
} else {
|
} else {
|
||||||
setError("Invalid ID");
|
setError("Invalid ID");
|
||||||
}
|
}
|
||||||
} else {
|
} else if (text !== "") {
|
||||||
setError(null);
|
setError(null);
|
||||||
}
|
}
|
||||||
}, [text]);
|
}, [text]);
|
||||||
|
@ -349,18 +347,18 @@ export function SettingArrayComponent({
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Enter ID or search for text"
|
placeholder={option.type === OptionType.ARRAY ? "Enter Text" : "Enter Text or ID"}
|
||||||
id={cl("input")}
|
id={cl("input")}
|
||||||
onChange={v => setText(v)}
|
onChange={v => setText(v)}
|
||||||
value={text}
|
value={text}
|
||||||
/>
|
/>
|
||||||
{!isNaN(Number(text)) && text !== "" ?
|
{option.type === OptionType.ARRAY || (!isNaN(Number(text)) && text !== "") ?
|
||||||
<Button
|
<Button
|
||||||
size={Button.Sizes.MIN}
|
size={Button.Sizes.MIN}
|
||||||
id={cl("add-button")}
|
id={cl("add-button")}
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
style={{ background: "none" }}
|
style={{ background: "none" }}
|
||||||
disabled={text.length < 18 || text.length > 19}
|
disabled={((text.length < 18 || text.length > 19) && option.type !== OptionType.ARRAY) || text === ""}
|
||||||
>
|
>
|
||||||
<CheckMarkIcon />
|
<CheckMarkIcon />
|
||||||
</Button> :
|
</Button> :
|
||||||
|
|
|
@ -72,6 +72,8 @@ function renderRegisteredPlugins(name: string, value: any) {
|
||||||
|
|
||||||
function MakeContextCallback(name: "Guild" | "User" | "Channel"): NavContextMenuPatchCallback {
|
function MakeContextCallback(name: "Guild" | "User" | "Channel"): NavContextMenuPatchCallback {
|
||||||
return (children, props) => {
|
return (children, props) => {
|
||||||
|
if (!registeredPlugins[OptionType.CHANNELS] && !registeredPlugins[OptionType.USERS] && !registeredPlugins[OptionType.GUILDS])
|
||||||
|
return;
|
||||||
const value = props[name.toLowerCase()];
|
const value = props[name.toLowerCase()];
|
||||||
if (!value) return;
|
if (!value) return;
|
||||||
if (props.label === getIntlMessage("CHANNEL_ACTIONS_MENU_LABEL")) return; // random shit like notification settings
|
if (props.label === getIntlMessage("CHANNEL_ACTIONS_MENU_LABEL")) return; // random shit like notification settings
|
||||||
|
|
Loading…
Add table
Reference in a new issue