From c68d684bc2822ff1bc83ec34db0826a1813ba4ae Mon Sep 17 00:00:00 2001 From: AndcoolSystems Date: Wed, 14 Aug 2024 02:15:25 +0300 Subject: [PATCH] normal objects values --- src/app/me/page.tsx | 2 +- src/app/me/stars/page.tsx | 2 +- src/app/users/[name]/client_code.tsx | 2 +- src/app/workshop/[id]/client_code.tsx | 2 +- src/app/workshop/page.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/me/page.tsx b/src/app/me/page.tsx index 9f5cd32..5b2abfe 100644 --- a/src/app/me/page.tsx +++ b/src/app/me/page.tsx @@ -45,7 +45,7 @@ const Main = () => { skinViewer.loadBackground("/static/background.png").then(() => asyncImage('/static/workshop_base.png').then((base_skin) => { Promise.all(data.map(async (el) => { try { - const result = await generateSkin(el.base64, base_skin, Object.values(el.categories).some(val => val.id == 3)) + const result = await generateSkin(el.base64, base_skin, el.categories.some(val => val.id == 3)) await skinViewer.loadSkin(result, { model: 'default' }); skinViewer.render(); const image = skinViewer.canvas.toDataURL(); diff --git a/src/app/me/stars/page.tsx b/src/app/me/stars/page.tsx index 7280319..0212e81 100644 --- a/src/app/me/stars/page.tsx +++ b/src/app/me/stars/page.tsx @@ -54,7 +54,7 @@ const Main = () => { skinViewer.loadBackground("/static/background.png").then(() => asyncImage('/static/workshop_base.png').then((base_skin) => { Promise.all(data.map(async (el) => { try { - const result = await generateSkin(el.base64, base_skin, Object.values(el.categories).some(val => val.id == 3)) + const result = await generateSkin(el.base64, base_skin, el.categories.some(val => val.id == 3)) await skinViewer.loadSkin(result, { model: 'default' }); skinViewer.render(); const image = skinViewer.canvas.toDataURL(); diff --git a/src/app/users/[name]/client_code.tsx b/src/app/users/[name]/client_code.tsx index 2ceaf88..942e5e1 100644 --- a/src/app/users/[name]/client_code.tsx +++ b/src/app/users/[name]/client_code.tsx @@ -29,7 +29,7 @@ const UsersClient = ({ user }: { user: Users }) => { skinViewer.loadBackground("/static/background.png").then(() => asyncImage('/static/workshop_base.png').then((base_skin) => { Promise.all(user.works.map(async (el) => { try { - const result = await generateSkin(el.base64, base_skin, Object.values(el.categories).some(val => val.id == 3)) + const result = await generateSkin(el.base64, base_skin, el.categories.some(val => val.id == 3)) await skinViewer.loadSkin(result, { model: 'default' }); skinViewer.render(); const image = skinViewer.canvas.toDataURL(); diff --git a/src/app/workshop/[id]/client_code.tsx b/src/app/workshop/[id]/client_code.tsx index a07d681..f126299 100644 --- a/src/app/workshop/[id]/client_code.tsx +++ b/src/app/workshop/[id]/client_code.tsx @@ -103,7 +103,7 @@ export default function Home({ data }: { data: Interfaces.Bandage }) { client.current.lining_canvas = lining_canvas; client.current.position = 6 - Math.floor(height / 2); client.current.updatePositionSlider(); - client.current.colorable = Object.values(data.categories).some(val => val.id.toString() === process.env.NEXT_PUBLIC_COLORABLE_ID); + client.current.colorable = data.categories.some(val => val.id.toString() === process.env.NEXT_PUBLIC_COLORABLE_ID); const randomColor = getRandomColor(); setRandomColor(randomColor); client.current.setParams({ color: randomColor }); diff --git a/src/app/workshop/page.tsx b/src/app/workshop/page.tsx index 6993869..25183a9 100644 --- a/src/app/workshop/page.tsx +++ b/src/app/workshop/page.tsx @@ -82,7 +82,7 @@ export default function Home() { skinViewer.loadBackground("/static/background.png").then(() => asyncImage('/static/workshop_base.png').then((base_skin) => { Promise.all(data.data.map(async (el) => { try { - const result = await generateSkin(el.base64, base_skin, Object.values(el.categories).some(val => val.id == 3)) + const result = await generateSkin(el.base64, base_skin, el.categories.some(val => val.id == 3)) await skinViewer.loadSkin(result, { model: 'default' }); skinViewer.render(); const image = skinViewer.canvas.toDataURL();