Skip to content

Commit

Permalink
feat: reload when modifying data
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jan 18, 2024
1 parent 2e6e32c commit ea5b353
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pages/premium/backup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
return
}
toast.success('Backup restored')
window.location.href = '/premium/dashboard?message=Backup restored successfully!'
}
useSeoMeta({
Expand Down
14 changes: 11 additions & 3 deletions pages/premium/dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { ArrowLeftOnRectangleIcon } from '@heroicons/vue/24/solid'
import { doesBrowserHaveOldVersionState } from '~/assets/js/BackupHelper'
import { toast } from 'vue-sonner'
const { user, logout: _signOut } = useAuth()
Expand All @@ -27,9 +28,7 @@
}
]
const doesHaveOldVersionStateData = doesBrowserHaveOldVersionState()
if (doesHaveOldVersionStateData) {
if (doesBrowserHaveOldVersionState()) {
links.unshift({
name: '⚠ Migrate old data ⚠',
description: 'Migrate your old saved posts, tag collections, etc',
Expand All @@ -42,6 +41,15 @@
// window.location.reload()
}
onNuxtReady(() => {
const route = useRoute()
const message = route.query.message
if (message) {
toast.success(message)
}
})
useSeoMeta({
title: 'Premium dashboard'
})
Expand Down
4 changes: 1 addition & 3 deletions pages/premium/migrate-old-data.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
return
}
toast.success('Old data migrated successfully!')
navigateTo('/premium/dashboard')
window.location.href = '/premium/dashboard?message=Old data migrated successfully!'
}
function removeOldData() {
Expand Down

0 comments on commit ea5b353

Please sign in to comment.