fix: add interval to uses of useNow so that it uses less resources
This commit is contained in:
parent
e369473dd0
commit
b77c7c2f45
@ -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>
|
||||
|
||||
|
@ -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() &&
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user