diff --git a/src/components/settings/tabs/plugins/PluginModal.tsx b/src/components/settings/tabs/plugins/PluginModal.tsx index f4512870c..d287b8340 100644 --- a/src/components/settings/tabs/plugins/PluginModal.tsx +++ b/src/components/settings/tabs/plugins/PluginModal.tsx @@ -84,22 +84,18 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti useEffect(() => { (async () => { - const loadedAuthors: Partial[] = []; - - for (const user of plugin.authors.slice(0, 6)) { + for (const [index, user] of plugin.authors.slice(0, 6).entries()) { try { const author = user.id ? await UserUtils.getUser(String(user.id)) .catch(() => makeDummyUser({ username: user.name })) : makeDummyUser({ username: user.name }); - loadedAuthors.push(author); + setAuthors(a => index === 0 ? [author] : [...a, author]); } catch (e) { continue; } } - - setAuthors(loadedAuthors.length ? loadedAuthors : [dummyAuthor]); })(); }, [plugin.authors]);