diff options
| author | Johann150 <johann.galle@protonmail.com> | 2022-02-08 08:38:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-08 16:38:52 +0900 |
| commit | e902178153099251efa23325fc1eaea51cc9e97c (patch) | |
| tree | 15f5e7f0ef7dfde05e3b8986c63fdb515fa5a188 /packages/client/src/components | |
| parent | Update CHANGELOG.md (diff) | |
| download | misskey-e902178153099251efa23325fc1eaea51cc9e97c.tar.gz misskey-e902178153099251efa23325fc1eaea51cc9e97c.tar.bz2 misskey-e902178153099251efa23325fc1eaea51cc9e97c.zip | |
fix: instance ticker (#8260)
* add type and default values
* remove unnecessary string operation
Diffstat (limited to 'packages/client/src/components')
| -rw-r--r-- | packages/client/src/components/instance-ticker.vue | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/packages/client/src/components/instance-ticker.vue b/packages/client/src/components/instance-ticker.vue index 77fd8bb344..9b0a18ec90 100644 --- a/packages/client/src/components/instance-ticker.vue +++ b/packages/client/src/components/instance-ticker.vue @@ -7,15 +7,27 @@ <script lang="ts" setup> import { } from 'vue'; +import { instanceName } from '@/config'; const props = defineProps<{ - instance: any; // TODO + instance?: { + faviconUrl?: string + name: string + themeColor?: string + } }>(); -const themeColor = props.instance.themeColor || '#777777'; +// if no instance data is given, this is for the local instance +const instance = props.instance ?? { + faviconUrl: '/favicon.ico', + name: instanceName, + themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement)?.content +}; + +const themeColor = instance.themeColor ?? '#777777'; const bg = { - background: `linear-gradient(90deg, ${themeColor}, ${themeColor + '00'})` + background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)` }; </script> |