mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 05:54:19 +01:00
update
This commit is contained in:
@@ -6,24 +6,10 @@ type ConfigProps = {
|
||||
};
|
||||
|
||||
const RelayConfig = () => {
|
||||
const { config, setConfig } = useConfig();
|
||||
const { config, setConfig, addRelay, removeRelay } = useConfig();
|
||||
|
||||
const [relayUrlInput, setRelayUrlInput] = createSignal<string>('');
|
||||
|
||||
const addRelay = (relayUrl: string) => {
|
||||
setConfig((current) => ({
|
||||
...current,
|
||||
relayUrls: [...current.relayUrls, relayUrl],
|
||||
}));
|
||||
};
|
||||
|
||||
const removeRelay = (relayUrl: string) => {
|
||||
setConfig((current) => ({
|
||||
...current,
|
||||
relayUrls: current.relayUrls.filter((e) => e !== relayUrl),
|
||||
}));
|
||||
};
|
||||
|
||||
const handleClickAddRelay: JSX.EventHandler<HTMLFormElement, Event> = (ev) => {
|
||||
ev.preventDefault();
|
||||
const relayUrl = ev.currentTarget?.relayUrl?.value as string | undefined;
|
||||
|
||||
Reference in New Issue
Block a user