Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

feat(client): :sparkles: ask for confirmation when resetting a resume

Amruth Pillai4d43f6a64271
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 3ea677e80..84f7c96c5 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -23,6 +23,7 @@
"i18n-ally.sortKeys": true,
"scss.validate": false,
"conventionalCommits.scopes": [
- "client"
+ "client",
+ "docker"
]
}
\ No newline at end of file
diff --git a/client/components/build/RightSidebar/sections/Settings.tsx b/client/components/build/RightSidebar/sections/Settings.tsx
index 7482b6e2a..b7c381073 100644
--- a/client/components/build/RightSidebar/sections/Settings.tsx
+++ b/client/components/build/RightSidebar/sections/Settings.tsx
@@ -15,7 +15,7 @@ import dayjs from 'dayjs';
import get from 'lodash/get';
import { useRouter } from 'next/router';
import { useTranslation } from 'next-i18next';
-import { useMemo } from 'react';
+import { useMemo, useState } from 'react';
import { useMutation } from 'react-query';
import Heading from '@/components/shared/Heading';
@@ -36,6 +36,8 @@ const Settings = () => {
const { locale, ...router } = useRouter();
+ const [confirmReset, setConfirmReset] = useState(false);
+
const resume = useAppSelector((state) => state.resume);
const theme = useAppSelector((state) => state.build.theme);
const pages = useAppSelector((state) => state.resume.metadata.layout);
@@ -78,9 +80,14 @@ const Settings = () => {
};
const handleResetResume = async () => {
+ if (!confirmReset) {
+ return setConfirmReset(true);
+ }
+
await resetResumeMutation({ id });
+ await queryClient.invalidateQueries(`resume/${username}/${slug}`);
- queryClient.invalidateQueries(`resume/${username}/${slug}`);
+ setConfirmReset(false);
};
return (
@@ -202,7 +209,11 @@ const Settings = () => {
<DeleteForever />
</ListItemIcon>
<ListItemText
- primary={t<string>('builder.rightSidebar.sections.settings.resume.reset.primary')}
+ primary={
+ confirmReset
+ ? 'Are you sure?'
+ : t<string>('builder.rightSidebar.sections.settings.resume.reset.primary')
+ }
secondary={t<string>('builder.rightSidebar.sections.settings.resume.reset.secondary')}
/>
</ListItemButton>