0

Make the error alert in OfflineEmbed closable (#4062)

This commit is contained in:
mahmed2000 2024-12-20 17:17:34 +00:00 committed by GitHub
parent 0b28a3b483
commit 8a1c05abf4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -80,6 +80,11 @@ export const OfflineEmbed: FC<OfflineEmbedProps> = ({
setLoading(false); setLoading(false);
}; };
const handleErrorClose = () => {
setErrorMessage('');
setCurrentMode(EmbedMode.FollowPrompt);
};
const handleAccountChange = a => { const handleAccountChange = a => {
setRemoteAccount(a); setRemoteAccount(a);
if (isValidFediverseAccount(a)) { if (isValidFediverseAccount(a)) {
@ -104,7 +109,14 @@ export const OfflineEmbed: FC<OfflineEmbedProps> = ({
<div className={styles.pageName}>{streamName}</div> <div className={styles.pageName}>{streamName}</div>
{errorMessage && ( {errorMessage && (
<Alert message="Follow Error" description={errorMessage} type="error" showIcon /> <Alert
message="Follow Error"
description={errorMessage}
type="error"
showIcon
closable
onClose={handleErrorClose}
/>
)} )}
{currentMode === EmbedMode.CanFollow && ( {currentMode === EmbedMode.CanFollow && (