summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkInstanceTicker.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2025-01-21 10:26:47 +0900
committerGitHub <noreply@github.com>2025-01-21 10:26:47 +0900
commite8b633efec5a26b6534cd59a3ca1dd14899defd1 (patch)
tree292a7e411e3012ace27ee440cf33196aa1977705 /packages/frontend/src/components/MkInstanceTicker.vue
parentenhance(frontend): クエリパラメータでuiを一時的に変更でき... (diff)
downloadsharkey-e8b633efec5a26b6534cd59a3ca1dd14899defd1.tar.gz
sharkey-e8b633efec5a26b6534cd59a3ca1dd14899defd1.tar.bz2
sharkey-e8b633efec5a26b6534cd59a3ca1dd14899defd1.zip
fix(frontend): Instanceの値が部分的に欠損していると、ローカルサーバーの情報にフォールバックする問題を修正 (#15319)
Diffstat (limited to 'packages/frontend/src/components/MkInstanceTicker.vue')
-rw-r--r--packages/frontend/src/components/MkInstanceTicker.vue19
1 files changed, 16 insertions, 3 deletions
diff --git a/packages/frontend/src/components/MkInstanceTicker.vue b/packages/frontend/src/components/MkInstanceTicker.vue
index 570c50b627..70c33a692d 100644
--- a/packages/frontend/src/components/MkInstanceTicker.vue
+++ b/packages/frontend/src/components/MkInstanceTicker.vue
@@ -17,6 +17,7 @@ import { instance as localInstance } from '@/instance.js';
import { getProxiedImageUrlNullable } from '@/scripts/media-proxy.js';
const props = defineProps<{
+ host: string | null;
instance?: {
faviconUrl?: string | null
name?: string | null
@@ -25,12 +26,24 @@ const props = defineProps<{
}>();
// if no instance data is given, this is for the local instance
-const instanceName = computed(() => props.instance?.name ?? localInstanceName);
+const instanceName = computed(() => props.host == null ? localInstanceName : props.instance?.name ?? props.host);
-const faviconUrl = computed(() => getProxiedImageUrlNullable(props.instance?.faviconUrl ?? localInstance.iconUrl, 'preview') ?? '/favicon.ico');
+const faviconUrl = computed(() => {
+ let imageSrc: string | null = null;
+ if (props.host == null) {
+ if (localInstance.iconUrl == null) {
+ return '/favicon.ico';
+ } else {
+ imageSrc = localInstance.iconUrl;
+ }
+ } else {
+ imageSrc = props.instance?.faviconUrl ?? null;
+ }
+ return getProxiedImageUrlNullable(imageSrc);
+});
const themeColorStyle = computed<CSSProperties>(() => {
- const themeColor = props.instance?.themeColor ?? localInstance.themeColor ?? '#777777';
+ const themeColor = (props.host == null ? localInstance.themeColor : props.instance?.themeColor) ?? '#777777';
return {
background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`,
};