diff --git a/src/utils.ts b/src/utils.ts index 298f06da7..6119bbb06 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -135,7 +135,7 @@ export const download = async (data: Record, filename: string) } export const computeSettingsDiff = (before: object, after: object) => { - const diffObj = diff(before, after); + let diffObj = diff(before, after); // diff converts arrays to objects, set original array back here const setArrays = (localAfter: object, localDiff: object): void => { @@ -149,7 +149,12 @@ export const computeSettingsDiff = (before: object, after: object) => { } } } - setArrays(after, diffObj); + if (Array.isArray(after)) { + diffObj = after; + } else { + setArrays(after, diffObj); + } + return diffObj; }