Fix this sending ghost requests
This commit is contained in:
@@ -95,27 +95,29 @@ export default function BerryDashChatroom () {
|
|||||||
.map(id => `"${id}"`)
|
.map(id => `"${id}"`)
|
||||||
.join(',')
|
.join(',')
|
||||||
|
|
||||||
;(async () => {
|
if (notInAllIds.length != 0) {
|
||||||
const result = await axios.get(
|
;(async () => {
|
||||||
`/api/berrydash/icon-marketplace/icon?ids=[${notInAllIds}]`
|
const result = await axios.get(
|
||||||
)
|
`/api/berrydash/icon-marketplace/icon?ids=[${notInAllIds}]`
|
||||||
if (result.data.success) {
|
)
|
||||||
const add: CustomIconEntry[] = []
|
if (result.data.success) {
|
||||||
for (const item of result.data.data) {
|
const add: CustomIconEntry[] = []
|
||||||
add.push({
|
for (const item of result.data.data) {
|
||||||
data: item.data,
|
add.push({
|
||||||
id: item.id
|
data: item.data,
|
||||||
})
|
id: item.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
setCustomIconCache(prev => [
|
||||||
|
...prev,
|
||||||
|
...result.data.data.map((item: CustomIconEntry) => ({
|
||||||
|
data: item.data,
|
||||||
|
id: item.id
|
||||||
|
}))
|
||||||
|
])
|
||||||
}
|
}
|
||||||
setCustomIconCache(prev => [
|
})()
|
||||||
...prev,
|
}
|
||||||
...result.data.data.map((item: CustomIconEntry) => ({
|
|
||||||
data: item.data,
|
|
||||||
id: item.id
|
|
||||||
}))
|
|
||||||
])
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
}, [messages])
|
}, [messages])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user