mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Update SettingsModal.jsx
This commit is contained in:
@@ -146,6 +146,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
|
|||||||
};
|
};
|
||||||
}, [copyStatus, checkedENS]);
|
}, [copyStatus, checkedENS]);
|
||||||
|
|
||||||
|
console.log(account)
|
||||||
|
|
||||||
const handleSavePlebbitOptions = async () => {
|
const handleSavePlebbitOptions = async () => {
|
||||||
let gatewayUrls = gatewayRef.current.value.split('\n').filter((url) => url.trim());
|
let gatewayUrls = gatewayRef.current.value.split('\n').filter((url) => url.trim());
|
||||||
@@ -165,9 +166,9 @@ const SettingsModal = ({ isOpen, closeModal }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const invalidUrls = [
|
const invalidUrls = [
|
||||||
...gatewayUrls || defaultGatewayUrls,
|
...(Array.isArray(gatewayUrls) ? gatewayUrls : (Array.isArray(defaultGatewayUrls) ? defaultGatewayUrls : [])),
|
||||||
...(ipfsClientsOptions || []),
|
...(Array.isArray(ipfsClientsOptions) ? ipfsClientsOptions : []),
|
||||||
...pubsubClientsOptions || defaultPubsubHttpClientsOptions,
|
...(Array.isArray(pubsubClientsOptions) ? pubsubClientsOptions : (Array.isArray(defaultPubsubHttpClientsOptions) ? defaultPubsubHttpClientsOptions : [])),
|
||||||
].filter((url) => !isValidURL(url));
|
].filter((url) => !isValidURL(url));
|
||||||
|
|
||||||
if (invalidUrls.length > 0) {
|
if (invalidUrls.length > 0) {
|
||||||
@@ -244,9 +245,9 @@ const SettingsModal = ({ isOpen, closeModal }) => {
|
|||||||
setNewErrorMessage(null);
|
setNewErrorMessage(null);
|
||||||
setNewSuccessMessage(null);
|
setNewSuccessMessage(null);
|
||||||
|
|
||||||
gatewayRef.current.value = defaultGatewayUrls.join('\n');
|
gatewayRef.current.value = defaultGatewayUrls ? defaultGatewayUrls.join('\n') : "";
|
||||||
ipfsRef.current.value = "";
|
ipfsRef.current.value = "";
|
||||||
pubsubRef.current.value = defaultPubsubHttpClientsOptions.join('\n');
|
pubsubRef.current.value = defaultPubsubHttpClientsOptions ? defaultPubsubHttpClientsOptions.join('\n') : "";
|
||||||
dataPathRef.current.value = "";
|
dataPathRef.current.value = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user