diff --git a/app/src/composables/use-preset/use-preset.ts b/app/src/composables/use-preset/use-preset.ts index 3a00361a23..bb12c9e43b 100644 --- a/app/src/composables/use-preset/use-preset.ts +++ b/app/src/composables/use-preset/use-preset.ts @@ -30,6 +30,7 @@ export function usePreset(collection: Ref, bookmark: Ref localPreset.value = { ...localPreset.value, id: updatedValues.id, + user: updatedValues.user, }; busy.value = false; return updatedValues; diff --git a/app/src/stores/presets.ts b/app/src/stores/presets.ts index d731f3a1e6..bbd7e8c4a6 100644 --- a/app/src/stores/presets.ts +++ b/app/src/stores/presets.ts @@ -3,7 +3,7 @@ import { Preset } from '@/types'; import { useUserStore } from '@/stores/'; import api from '@/api'; import { nanoid } from 'nanoid'; -import { merge } from 'lodash'; +import { merge, cloneDeep } from 'lodash'; const defaultPreset: Omit = { bookmark: null, @@ -246,7 +246,7 @@ export const usePresetsStore = createStore({ const { id: userID } = userStore.state.currentUser; // Clone the preset to make sure the future deletes don't affect the original object - preset = { ...preset }; + preset = cloneDeep(preset); if (preset.id === undefined || preset.id === null) { return await this.create({