Skip to content

Commit

Permalink
Reset Leaderboard storeon log out
Browse files Browse the repository at this point in the history
  • Loading branch information
brayo-pip committed Mar 22, 2024
1 parent 98992f4 commit 544bc40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
import { useScreenTimeStore } from '@/stores/screentime'
import { useLeaderboardStore } from '@/stores/leaderboard'
export default {
name: 'AWLLoginForm',
setup() {
const email = ref('')
const password = ref('')
const auth = useAuthStore()
const userTime = useScreenTimeStore()
const router = useRouter()
if (auth.isAuthenticated) {
router.push({ name: 'Dashboard' })
} else {
userTime.resetStore()
useScreenTimeStore().resetStore()
useLeaderboardStore().resetStore()
}
const login = async () => {
try {
Expand Down

0 comments on commit 544bc40

Please sign in to comment.