diff --git a/components/dashboard/links/Index.vue b/components/dashboard/links/Index.vue index 9a72ae3..849e9e4 100644 --- a/components/dashboard/links/Index.vue +++ b/components/dashboard/links/Index.vue @@ -14,9 +14,9 @@ const displayedLinks = computed(() => { const sorted = [...links.value] switch (sortBy.value) { case 'newest': - return sorted.sort((a, b) => a.createdAt - b.createdAt) - case 'oldest': return sorted.sort((a, b) => b.createdAt - a.createdAt) + case 'oldest': + return sorted.sort((a, b) => a.createdAt - b.createdAt) case 'az': return sorted.sort((a, b) => a.slug.localeCompare(b.slug)) case 'za': @@ -68,6 +68,7 @@ function updateLinkList(link, type) { } else { links.value.unshift(link) + sortBy.value = 'newest' } } diff --git a/components/dashboard/links/QRCode.vue b/components/dashboard/links/QRCode.vue index d445ecc..7f788d5 100644 --- a/components/dashboard/links/QRCode.vue +++ b/components/dashboard/links/QRCode.vue @@ -1,5 +1,4 @@