chore: legacy fixes (#2343)
This commit is contained in:
@@ -9,16 +9,22 @@ export function findDefaultItemsKey(itemsKeys: ItemsKeyInterface[]): ItemsKeyInt
|
||||
return key.isDefault
|
||||
})
|
||||
|
||||
if (defaultKeys.length > 1) {
|
||||
/**
|
||||
* Prioritize one that is synced, as neverSynced keys will likely be deleted after
|
||||
* DownloadFirst sync.
|
||||
*/
|
||||
const syncedKeys = defaultKeys.filter((key) => !key.neverSynced)
|
||||
if (syncedKeys.length > 0) {
|
||||
return syncedKeys[0]
|
||||
}
|
||||
if (defaultKeys.length === 0) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return defaultKeys[0]
|
||||
if (defaultKeys.length === 1) {
|
||||
return defaultKeys[0]
|
||||
}
|
||||
|
||||
/**
|
||||
* Prioritize one that is synced, as neverSynced keys will likely be deleted after
|
||||
* DownloadFirst sync.
|
||||
*/
|
||||
const syncedKeys = defaultKeys.filter((key) => !key.neverSynced)
|
||||
if (syncedKeys.length > 0) {
|
||||
return syncedKeys[0]
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user