mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	fix: instance ticker (#8260)
* add type and default values * remove unnecessary string operation
This commit is contained in:
		
							parent
							
								
									5416f38eb4
								
							
						
					
					
						commit
						e902178153
					
				
					 1 changed files with 15 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -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>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue