Skip to content

Commit

Permalink
fixup! feature: add update modal and not show system prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
maparr committed Dec 21, 2023
1 parent 81c08f0 commit f7b799e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 104 deletions.
38 changes: 1 addition & 37 deletions app/components/common/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ import { getNetworkInfo } from '../../redux/network/selectors';
import { checkUpdates as checkUpdatesIco } from '../../assets/images';
import { AppThDispatch } from '../../types';
import updaterSlice from '../../redux/updater/slice';
import { SECOND } from '../../../shared/constants';
import { Loader } from '../../basicComponents';
import UpdateApplicationWarningModal from '../../screens/modal/UpdateApplicationWarningModal';
import FeedbackButton from './Feedback';

const Container = styled.div`
Expand Down Expand Up @@ -197,29 +194,6 @@ const UpdateStatus = () => {
const isDownloading = useSelector(isUpdateDownloading);
const isDownloaded = useSelector(isUpdateDownloaded);
const error = useSelector(getError);
const [
isOpenUpdateApplicationWarningModal,
setIsOpenUpdateApplicationWarningModal,
] = useState(false);
const [
showUpdateApplicationLoader,
setShowUpdateApplicationLoader,
] = useState(false);

const handleRestartNow = () => {
setIsOpenUpdateApplicationWarningModal(false);
setShowUpdateApplicationLoader(true);
eventsService.installUpdate();

setTimeout(() => {
setShowUpdateApplicationLoader(false);
}, 10 * SECOND);
};

const handlePostpone = () => {
setIsOpenUpdateApplicationWarningModal(false);
};

if (!isDownloading && !isDownloaded) return null;

if (progress !== null && !isDownloaded) {
Expand All @@ -233,19 +207,9 @@ const UpdateStatus = () => {
return (
<>
<ProgressChunk>Update is ready to install</ProgressChunk>
<PrimaryAction
onClick={() => setIsOpenUpdateApplicationWarningModal(true)}
>
<PrimaryAction onClick={() => eventsService.installUpdate()}>
Restart Smapp
</PrimaryAction>
<UpdateApplicationWarningModal
isOpen={isOpenUpdateApplicationWarningModal}
onApprove={handleRestartNow}
onCancel={handlePostpone}
/>
{showUpdateApplicationLoader && (
<Loader size={Loader.sizes.BIG} note="UPDATE IN PROGESS..." />
)}
</>
);
}
Expand Down
67 changes: 0 additions & 67 deletions app/screens/modal/UpdateApplicationWarningModal.tsx

This file was deleted.

0 comments on commit f7b799e

Please sign in to comment.