mirror of
https://github.com/comatory/fb2iCal
synced 2025-06-05 22:09:25 +02:00
improvement: add record migration and correct state normalization in new code
This commit is contained in:
@@ -88,8 +88,22 @@ const deleteRecord = (id) => {
|
||||
updateStorage(nextStorage)
|
||||
}
|
||||
|
||||
const sortRecord = (a, b) => {
|
||||
const aDate = new Date(a.createdAt)
|
||||
const bDate = new Date(b.createdAt)
|
||||
|
||||
if (aDate < bDate) {
|
||||
return -1
|
||||
}
|
||||
if (aDate > bDate) {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
export {
|
||||
migrateRecord,
|
||||
sortRecord,
|
||||
getStorage,
|
||||
getConfigStorage,
|
||||
getStorageContents,
|
||||
|
Reference in New Issue
Block a user