Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
prokawsar committed Aug 24, 2024
1 parent 80146bf commit d02cb74
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/routes/(app)/history/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import HistoryRow from '$lib/elements/HistoryRow.svelte'
import Loader from '$lib/elements/Loader.svelte'
import { softDeleteHistory } from '$lib/utils/services.js'
import { sortedByCreatedAt } from '$lib/utils/tools.js'
import Icon from '@iconify/svelte'
import mixpanel from 'mixpanel-browser'
import { toast } from 'svelte-sonner'
Expand All @@ -21,18 +22,6 @@
isLoading = false
toast.message('History moved to trash!')
}
const sortedByCreatedAt = (data: any) => {
return data.sort((a: any, b: any) => {
// Convert 'created_at' strings to Date objects
let dateA = new Date(a.created_at)
let dateB = new Date(b.created_at)
if (dateA > dateB) return -1
if (dateA < dateB) return 1
return 0
})
}
</script>

<svelte:head>
Expand Down

0 comments on commit d02cb74

Please sign in to comment.