mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
add error toasts from hooks
This commit is contained in:
@@ -35,12 +35,20 @@ const Pending = () => {
|
||||
|
||||
const account = useAccount();
|
||||
const comment = useAccountComment({commentIndex: index});
|
||||
const { publishingState } = useAccountComment({commentIndex: index});
|
||||
const { publishingState, error } = useAccountComment({commentIndex: index});
|
||||
|
||||
const [visible] = useState(true);
|
||||
const [errorMessage] = useState(null);
|
||||
|
||||
const [errorMessage, setErrorMessage] = useState(null);
|
||||
useError(errorMessage, [errorMessage]);
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
const errorMessage = formatState(error);
|
||||
setErrorMessage(errorMessage);
|
||||
}
|
||||
}, [error]);
|
||||
|
||||
const navigate = useNavigate();
|
||||
const [commentMediaInfo, setCommentMediaInfo] = useState(null);
|
||||
const fallbackImgUrl = "assets/filedeleted-res.gif";
|
||||
|
||||
Reference in New Issue
Block a user