fix: admin/home: random-plugin had broken image on some plugins
Massimo Melina committed
Sep 15, 2025 at 17:38 UTC
ccf4e98f69f969ba2affc35ed75a840ae96c8d76
1 file changed
+2
-2
admin/src/RandomPlugin.ts
+2
-2
@@ -3,7 +3,7 @@ import { Box, Card, CardActions, CardContent } from '@mui/material'
3
import { Btn } from './mui'
4
import { state, useSnapState } from './state'
5
import { useApiList } from './api'
6
-import { DAY, tryJson } from '../../src/cross'
6
+import { DAY, tryJson, wantArray } from './misc'
7
import _ from 'lodash'
8
import { renderName } from './InstalledPlugins'
9
import { installPluginFromResult } from './OnlinePlugins'
@@ -37,7 +37,7 @@ export function RandomPlugin() {
37
h(Box, { fontWeight: 'bold', fontSize: '1.8em', my: 1 }, renderName({ row: one })),
38
h(Box, {}, one.description),
39
one.preview && h('img', {
40
- src: one.preview[0],
40
+ src: wantArray(one.preview)[0],
41
style: {
42
maxWidth: '100%',
43
maxHeight: '50vh',