diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-08 17:33:04 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-08 17:33:04 +0900 |
| commit | e4c2bba89a61280137c1dda2a4e72f8139346b92 (patch) | |
| tree | ccdce13e1864a466595b761e70145fceb0040aef /packages/client/src/widgets/instance-cloud.vue | |
| parent | refactor(server): rename AppModule to RootModule (diff) | |
| download | sharkey-e4c2bba89a61280137c1dda2a4e72f8139346b92.tar.gz sharkey-e4c2bba89a61280137c1dda2a4e72f8139346b92.tar.bz2 sharkey-e4c2bba89a61280137c1dda2a4e72f8139346b92.zip | |
fix(client): use proxied image for instance icon
Diffstat (limited to 'packages/client/src/widgets/instance-cloud.vue')
| -rw-r--r-- | packages/client/src/widgets/instance-cloud.vue | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/client/src/widgets/instance-cloud.vue b/packages/client/src/widgets/instance-cloud.vue index f8e463ee33..4965616995 100644 --- a/packages/client/src/widgets/instance-cloud.vue +++ b/packages/client/src/widgets/instance-cloud.vue @@ -4,7 +4,7 @@ <MkTagCloud v-if="activeInstances"> <li v-for="instance in activeInstances" :key="instance.id"> <a @click.prevent="onInstanceClick(instance)"> - <img style="width: 32px;" :src="instance.iconUrl"> + <img style="width: 32px;" :src="getInstanceIcon(instance)"> </a> </li> </MkTagCloud> @@ -20,6 +20,7 @@ import MkContainer from '@/components/MkContainer.vue'; import MkTagCloud from '@/components/MkTagCloud.vue'; import * as os from '@/os'; import { useInterval } from '@/scripts/use-interval'; +import { getProxiedImageUrlNullable } from '@/scripts/media-proxy'; const name = 'instanceCloud'; @@ -64,6 +65,10 @@ useInterval(() => { afterMounted: true, }); +function getInstanceIcon(instance): string { + return getProxiedImageUrlNullable(instance.iconUrl, 'preview') ?? getProxiedImageUrlNullable(instance.faviconUrl, 'preview') ?? '/client-assets/dummy.png'; +} + defineExpose<WidgetComponentExpose>({ name, configure, |