fix: add interval to uses of useNow so that it uses less resources
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kolaente 2023-03-16 19:14:58 +01:00
parent 6e3d64d6ef
commit d3289cc07b
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 9 additions and 3 deletions

View File

@ -5,7 +5,9 @@ import { useNow } from '@vueuse/core'
import LogoFull from '@/assets/logo-full.svg?component'
import LogoFullPride from '@/assets/logo-full-pride.svg?component'
const now = useNow()
const now = useNow({
interval: 24 * 60 * 60 * 1000, // Every day
})
const Logo = computed(() => now.value.getMonth() === 5 ? LogoFullPride : LogoFull)
</script>

View File

@ -157,7 +157,9 @@ function openTask(e: {
const weekDayFromDate = useWeekDayFromDate()
const today = useNow()
const today = useNow({
interval: 6 * 60 * 60 * 1000, // Every 6 hours
})
const dateIsToday = computed(() => (date: Date) => {
return (
date.getDate() === today.value.getDate() &&

View File

@ -9,7 +9,9 @@ export type Daytime = 'night' | 'morning' | 'day' | 'evening'
export function useDaytimeSalutation() {
const {t} = useI18n({useScope: 'global'})
const now = useNow()
const now = useNow({
interval: 30 * 60 * 1000, // Every 30 minutes
})
const authStore = useAuthStore()
const name = computed(() => authStore.userDisplayName)