social networks
This commit is contained in:
@@ -250,7 +250,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
texts: [...item.texts, { ...text, id: uuidv4() }],
|
||||
texts: [...(item.texts || []), { ...text, id: uuidv4() }],
|
||||
}
|
||||
: item
|
||||
),
|
||||
@@ -272,7 +272,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
index === activeIndex
|
||||
? {
|
||||
...item,
|
||||
texts: [...item.texts, { ...text, id: uuidv4() }],
|
||||
texts: [...(item.texts || []), { ...text, id: uuidv4() }],
|
||||
}
|
||||
: item
|
||||
);
|
||||
@@ -302,7 +302,10 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
buttons: [...item.buttons, { ...button, id: uuidv4() }],
|
||||
buttons: [
|
||||
...(item.buttons || []),
|
||||
{ ...button, id: uuidv4() },
|
||||
],
|
||||
}
|
||||
: item
|
||||
),
|
||||
@@ -324,7 +327,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
index === activeIndex
|
||||
? {
|
||||
...item,
|
||||
buttons: [...item.buttons, { ...button, id: uuidv4() }],
|
||||
buttons: [...(item.buttons || []), { ...button, id: uuidv4() }],
|
||||
}
|
||||
: item
|
||||
);
|
||||
@@ -355,7 +358,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
texts: item.texts.map((text) =>
|
||||
texts: (item.texts || []).map((text) =>
|
||||
text.id === textId ? { ...text, ...updates } : text
|
||||
),
|
||||
}
|
||||
@@ -380,7 +383,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
buttons: item.buttons.map((button) =>
|
||||
buttons: (item.buttons || []).map((button) =>
|
||||
button.id === buttonId ? { ...button, ...updates } : button
|
||||
),
|
||||
}
|
||||
@@ -404,7 +407,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
images: [...item.images, { ...image, id: uuidv4() }],
|
||||
images: [...(item.images || []), { ...image, id: uuidv4() }],
|
||||
}
|
||||
: item
|
||||
),
|
||||
@@ -426,7 +429,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
index === activeIndex
|
||||
? {
|
||||
...item,
|
||||
images: [...item.images, { ...image, id: uuidv4() }],
|
||||
images: [...(item.images || []), { ...image, id: uuidv4() }],
|
||||
}
|
||||
: item
|
||||
);
|
||||
@@ -457,7 +460,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
images: item.images.map((image) =>
|
||||
images: (item.images || []).map((image) =>
|
||||
image.id === imageId ? { ...image, ...updates } : image
|
||||
),
|
||||
}
|
||||
@@ -481,7 +484,9 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
texts: item.texts.filter((text) => text.id !== textId),
|
||||
texts: (item.texts || []).filter(
|
||||
(text) => text.id !== textId
|
||||
),
|
||||
}
|
||||
: item
|
||||
),
|
||||
@@ -505,7 +510,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
buttons: item.buttons.filter(
|
||||
buttons: (item.buttons || []).filter(
|
||||
(button) => button.id !== buttonId
|
||||
),
|
||||
}
|
||||
@@ -531,7 +536,9 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
images: item.images.filter((image) => image.id !== imageId),
|
||||
images: (item.images || []).filter(
|
||||
(image) => image.id !== imageId
|
||||
),
|
||||
}
|
||||
: item
|
||||
),
|
||||
@@ -555,7 +562,10 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
socials: [...item.socials, { ...social, id: uuidv4() }],
|
||||
socials: [
|
||||
...(item.socials || []),
|
||||
{ ...social, id: uuidv4() },
|
||||
],
|
||||
}
|
||||
: item
|
||||
),
|
||||
@@ -577,7 +587,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
index === activeIndex
|
||||
? {
|
||||
...item,
|
||||
socials: [...item.socials, { ...social, id: uuidv4() }],
|
||||
socials: [...(item.socials || []), { ...social, id: uuidv4() }],
|
||||
}
|
||||
: item
|
||||
);
|
||||
@@ -608,7 +618,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
socials: item.socials.map((social) =>
|
||||
socials: (item.socials || []).map((social) =>
|
||||
social.id === socialId ? { ...social, ...updates } : social
|
||||
),
|
||||
}
|
||||
@@ -632,7 +642,7 @@ export const usePersonalityStore = create<PersonalityStore>((set) => ({
|
||||
item.id === itemId
|
||||
? {
|
||||
...item,
|
||||
socials: item.socials.filter(
|
||||
socials: (item.socials || []).filter(
|
||||
(social) => social.id !== socialId
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user