From 17e9cad9e3ac0a59e90502f654f613907067f0bb Mon Sep 17 00:00:00 2001 From: enes Date: Thu, 9 Jan 2025 14:30:54 +0100 Subject: [PATCH] refactor(mods): use lodash clone --- src/utils/mod.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/mod.ts b/src/utils/mod.ts index 04ecdfa..dfa15ba 100644 --- a/src/utils/mod.ts +++ b/src/utils/mod.ts @@ -1,3 +1,4 @@ +import _ from 'lodash' import { NDKEvent } from '@nostr-dev-kit/ndk' import { Event } from 'nostr-tools' import { ModDetails, ModFormState } from '../types' @@ -131,10 +132,10 @@ export const initializeFormState = ( originalAuthor: existingModData?.originalAuthor || undefined, screenshotsUrls: existingModData?.screenshotsUrls || [''], tags: existingModData?.tags.join(',') || '', - lTags: existingModData ? [...existingModData.lTags] : [], - LTags: existingModData ? [...existingModData.LTags] : [], + lTags: existingModData ? _.clone(existingModData.lTags) : [], + LTags: existingModData ? _.clone(existingModData.lTags) : [], downloadUrls: existingModData - ? [...existingModData.downloadUrls.map((url) => ({ ...url }))] + ? _.cloneDeep(existingModData.downloadUrls) : [ { url: '',