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!

Use initial state for section missing in an import.

Matthias Steffen828c7dc26a94
diff --git a/src/context/AppContext.js b/src/context/AppContext.js
index 17b3c171a..c895c2821 100644
--- a/src/context/AppContext.js
+++ b/src/context/AppContext.js
@@ -112,6 +112,13 @@ const reducer = (state, { type, payload }) => {
return state;
case 'import_data':
if (payload === null) return initialState;
+
+ for(const section of Object.keys(initialState.data)){
+ if(!(section in payload.data)){
+ payload.data[section] = initialState.data[section];
+ }
+ }
+
return {
...state,
data: payload.data,