From 55effdecb452aebf3f2ebb7a807a51813c191b11 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Tue, 2 Nov 2021 18:46:30 +0200 Subject: [PATCH] disable clear data button when clicked once --- src/App/ErrorDialog/ErrorDialog.js | 4 +++- src/App/ErrorDialog/styles.less | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/App/ErrorDialog/ErrorDialog.js b/src/App/ErrorDialog/ErrorDialog.js index 4026f4555..bfa904e2b 100644 --- a/src/App/ErrorDialog/ErrorDialog.js +++ b/src/App/ErrorDialog/ErrorDialog.js @@ -7,11 +7,13 @@ const { Button, Image } = require('stremio/common'); const styles = require('./styles'); const ErrorDialog = ({ className }) => { + const [dataCleared, setDataCleared] = React.useState(false); const reload = React.useCallback(() => { window.location.reload(); }, []); const clearData = React.useCallback(() => { window.localStorage.clear(); + setDataCleared(true); }, []); return (
@@ -25,7 +27,7 @@ const ErrorDialog = ({ className }) => { -
diff --git a/src/App/ErrorDialog/styles.less b/src/App/ErrorDialog/styles.less index 9c91f9e29..8f9b120a5 100644 --- a/src/App/ErrorDialog/styles.less +++ b/src/App/ErrorDialog/styles.less @@ -55,6 +55,10 @@ background-color: @color-accent3-light1; } + &:global(.disabled) { + background-color: @color-surface-dark5; + } + .label { flex-grow: 0; flex-shrink: 1;