summaryrefslogtreecommitdiff
path: root/packages/client/src/components
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-12-10 16:52:05 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-12-10 16:52:05 +0900
commitfc44d4c9f9f291930f2e20541dd7da14d8471aaa (patch)
treea9762ed95d3e095d7949c98fedc133451e735fd1 /packages/client/src/components
parent:art: (diff)
downloadsharkey-fc44d4c9f9f291930f2e20541dd7da14d8471aaa.tar.gz
sharkey-fc44d4c9f9f291930f2e20541dd7da14d8471aaa.tar.bz2
sharkey-fc44d4c9f9f291930f2e20541dd7da14d8471aaa.zip
fix(client): use proxied image for instance icon
Diffstat (limited to 'packages/client/src/components')
-rw-r--r--packages/client/src/components/MkInstanceCardMini.vue7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/client/src/components/MkInstanceCardMini.vue b/packages/client/src/components/MkInstanceCardMini.vue
index f6e2f4eaa7..4625de40af 100644
--- a/packages/client/src/components/MkInstanceCardMini.vue
+++ b/packages/client/src/components/MkInstanceCardMini.vue
@@ -1,6 +1,6 @@
<template>
<div :class="[$style.root, { yellow: instance.isNotResponding, red: instance.isBlocked, gray: instance.isSuspended }]">
- <img v-if="instance.iconUrl" class="icon" :src="instance.iconUrl" alt=""/>
+ <img class="icon" :src="getInstanceIcon(instance)" alt=""/>
<div class="body">
<span class="host">{{ instance.name ?? instance.host }}</span>
<span class="sub _monospace"><b>{{ instance.host }}</b> / {{ instance.softwareName || '?' }} {{ instance.softwareVersion }}</span>
@@ -13,6 +13,7 @@
import * as misskey from 'misskey-js';
import MkMiniChart from '@/components/MkMiniChart.vue';
import * as os from '@/os';
+import { getProxiedImageUrlNullable } from '@/scripts/media-proxy';
const props = defineProps<{
instance: misskey.entities.Instance;
@@ -25,6 +26,10 @@ os.apiGet('charts/instance', { host: props.instance.host, limit: 16 + 1, span: '
res.requests.received.splice(0, 1);
chartValues = res.requests.received;
});
+
+function getInstanceIcon(instance): string {
+ return getProxiedImageUrlNullable(instance.iconUrl, 'preview') ?? getProxiedImageUrlNullable(instance.faviconUrl, 'preview') ?? '/client-assets/dummy.png';
+}
</script>
<style lang="scss" module>