mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
added error pop-up
This commit is contained in:
@@ -7,6 +7,7 @@ import CaptchaModal from './CaptchaModal';
|
||||
import { useFeed, useAccountsActions } from '@plebbit/plebbit-react-hooks';
|
||||
import InfiniteScroll from 'react-infinite-scroller';
|
||||
import { Tooltip } from 'react-tooltip';
|
||||
import onError from '../utils/onError';
|
||||
import getDate from '../utils/getDate';
|
||||
import renderComments from '../utils/renderComments';
|
||||
|
||||
@@ -181,9 +182,6 @@ const Board = ({ setBodyStyle }) => {
|
||||
}
|
||||
|
||||
|
||||
const onError = (error) => console.error(error)
|
||||
|
||||
|
||||
const getChallengeAnswersFromUser = async (challenges) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const imageString = challenges?.challenges[0].challenge;
|
||||
@@ -268,14 +266,14 @@ const Board = ({ setBodyStyle }) => {
|
||||
subplebbitAddress: selectedAddress,
|
||||
onChallengeVerification,
|
||||
onChallenge,
|
||||
onError,
|
||||
onError: onError,
|
||||
});
|
||||
console.log(`Comment pending with index: ${pendingComment.index}`);
|
||||
setName('');
|
||||
setSubject('');
|
||||
setComment('');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
onError(error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Threads } from './styles/Catalog.styled';
|
||||
import { useFeed, useAccountsActions } from '@plebbit/plebbit-react-hooks';
|
||||
import ImageBanner from './ImageBanner';
|
||||
import CaptchaModal from './CaptchaModal';
|
||||
import onError from '../utils/onError';
|
||||
import InfiniteScroll from 'react-infinite-scroller';
|
||||
|
||||
|
||||
@@ -241,14 +242,14 @@ const Catalog = ({ setBodyStyle }) => {
|
||||
subplebbitAddress: selectedAddress,
|
||||
onChallengeVerification,
|
||||
onChallenge,
|
||||
onError,
|
||||
onError: onError,
|
||||
});
|
||||
console.log(`Comment pending with index: ${pendingComment.index}`);
|
||||
setName('');
|
||||
setSubject('');
|
||||
setComment('');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
onError(error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useComment, useAccountsActions } from '@plebbit/plebbit-react-hooks';
|
||||
import ImageBanner from './ImageBanner';
|
||||
import CaptchaModal from './CaptchaModal';
|
||||
import { Tooltip } from 'react-tooltip';
|
||||
import onError from '../utils/onError';
|
||||
import getDate from '../utils/getDate';
|
||||
import renderThreadComments from '../utils/renderThreadComments';
|
||||
|
||||
@@ -156,9 +157,6 @@ const Thread = ({ setBodyStyle }) => {
|
||||
await comment.publishChallengeAnswers(challengeAnswers)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const onError = (error) => console.error(error)
|
||||
|
||||
|
||||
const getChallengeAnswersFromUser = async (challenges) => {
|
||||
@@ -241,14 +239,14 @@ const Thread = ({ setBodyStyle }) => {
|
||||
subplebbitAddress: selectedAddress,
|
||||
onChallengeVerification,
|
||||
onChallenge,
|
||||
onError,
|
||||
onError: onError,
|
||||
});
|
||||
console.log(`Comment pending with index: ${pendingComment.index}`);
|
||||
setName('');
|
||||
setSubject('');
|
||||
setCommentContent('');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
onError(error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user