Skip to content

Commit

Permalink
fix(minor): several minor bugs (#611)
Browse files Browse the repository at this point in the history
* chore: env

* fix(minor): removed dayjs and used vanilla javascript date

* fix(minor): stringified avatar url to fix the problem with undefined
  • Loading branch information
q1zhen authored Sep 9, 2024
1 parent 29cf5bf commit 2e8d5f0
Show file tree
Hide file tree
Showing 4 changed files with 7,496 additions and 9,793 deletions.
2 changes: 1 addition & 1 deletion components/custom/Nav/user/User.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function signOutHandler() {
<DropdownMenuTrigger as-child>
<Button class="relative h-8 w-8 rounded-full" variant="ghost">
<Avatar class="h-8 w-8">
<AvatarImage :src="user?.imageUrl!" />
<AvatarImage :src="String(user?.imageUrl!)" />
<AvatarFallback>C</AvatarFallback>
</Avatar>
</Button>
Expand Down
1 change: 0 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default defineNuxtConfig({
'nuxt-icon',
'@nuxt/fonts',
'nuxt-svgo',
'dayjs-nuxt',
'@sentry/nuxt/module',
'@nuxt/image',
],
Expand Down
10 changes: 6 additions & 4 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ definePageMeta({
useHead({
title: 'Home | Enspire',
})
const now = new Date().getHours()
</script>

<template>
<div class="text-3xl font-bold">
{{
$dayjs().hour() < 5 ? '晚上好!'
: $dayjs().hour() < 12 ? '早上好!'
: $dayjs().hour() < 13 ? '中午好!'
: $dayjs().hour() < 18 ? '下午好!' : '晚上好!'
now < 5 ? '晚上好!'
: now < 12 ? '早上好!'
: now < 13 ? '中午好!'
: now < 18 ? '下午好!' : '晚上好!'
}}
</div>
<div class="text-muted-foreground">
Expand Down
Loading

0 comments on commit 2e8d5f0

Please sign in to comment.