Update Authors
Co-Authored-By: Etorix <92535668+etorixdev@users.noreply.github.com>
This commit is contained in:
parent
d0c16d1b14
commit
1b03f94e8a
1 changed files with 2 additions and 6 deletions
|
|
@ -84,22 +84,18 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti
|
|||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
const loadedAuthors: Partial<User>[] = [];
|
||||
|
||||
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]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue