mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-08-09 12:57:23 +00:00
refactor(core): simplify error page ux
This commit is contained in:
parent
b423c866de
commit
2f09277e30
1 changed files with 2 additions and 13 deletions
|
|
@ -9,15 +9,9 @@ import styles from './styles.less';
|
|||
const Error = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [dataCleared, setDataCleared] = React.useState(false);
|
||||
|
||||
const reload = React.useCallback(() => {
|
||||
window.location.reload();
|
||||
}, []);
|
||||
|
||||
const clearData = React.useCallback(() => {
|
||||
window.localStorage.clear();
|
||||
setDataCleared(true);
|
||||
window.location.reload();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
|
@ -31,12 +25,7 @@ const Error = () => {
|
|||
{ t('GENERIC_ERROR_MESSAGE') }
|
||||
</div>
|
||||
<div className={styles['buttons-container']}>
|
||||
<Button className={styles['button-container']} title={t('TRY_AGAIN')} onClick={reload}>
|
||||
<div className={styles['label']}>
|
||||
{ t('TRY_AGAIN') }
|
||||
</div>
|
||||
</Button>
|
||||
<Button className={styles['button-container']} disabled={dataCleared} title={t('CLEAR_DATA')} onClick={clearData}>
|
||||
<Button className={styles['button-container']} title={t('CLEAR_DATA')} onClick={clearData}>
|
||||
<div className={styles['label']}>
|
||||
{ t('CLEAR_DATA') }
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue