Cache forms #187

Merged
enes merged 9 commits from 166-caching-fields into staging 2025-01-09 13:45:45 +00:00
Showing only changes of commit 17e9cad9e3 - Show all commits

View File

@ -1,3 +1,4 @@
import _ from 'lodash'
import { NDKEvent } from '@nostr-dev-kit/ndk' import { NDKEvent } from '@nostr-dev-kit/ndk'
import { Event } from 'nostr-tools' import { Event } from 'nostr-tools'
import { ModDetails, ModFormState } from '../types' import { ModDetails, ModFormState } from '../types'
@ -131,10 +132,10 @@ export const initializeFormState = (
originalAuthor: existingModData?.originalAuthor || undefined, originalAuthor: existingModData?.originalAuthor || undefined,
screenshotsUrls: existingModData?.screenshotsUrls || [''], screenshotsUrls: existingModData?.screenshotsUrls || [''],
tags: existingModData?.tags.join(',') || '', tags: existingModData?.tags.join(',') || '',
lTags: existingModData ? [...existingModData.lTags] : [], lTags: existingModData ? _.clone(existingModData.lTags) : [],
LTags: existingModData ? [...existingModData.LTags] : [], LTags: existingModData ? _.clone(existingModData.lTags) : [],
downloadUrls: existingModData downloadUrls: existingModData
? [...existingModData.downloadUrls.map((url) => ({ ...url }))] ? _.cloneDeep(existingModData.downloadUrls)
: [ : [
{ {
url: '', url: '',