support login data
This commit is contained in:
@@ -3,6 +3,8 @@ import type {
|
||||
BookmarkSummary,
|
||||
ExtensionSortKey,
|
||||
ExtensionSummary,
|
||||
PasswordSiteSortKey,
|
||||
PasswordSiteSummary,
|
||||
AssociatedProfileSortKey,
|
||||
AssociatedProfileSummary,
|
||||
BookmarkAssociatedProfileSummary,
|
||||
@@ -76,6 +78,16 @@ export function sortBookmarks(items: BookmarkSummary[], sortKey: BookmarkSortKey
|
||||
});
|
||||
}
|
||||
|
||||
export function sortPasswordSites(items: PasswordSiteSummary[], sortKey: PasswordSiteSortKey) {
|
||||
const passwordSites = [...items];
|
||||
return passwordSites.sort((left, right) => {
|
||||
if (sortKey === "url") {
|
||||
return compareOptionalText(left.url, right.url) || compareText(left.domain, right.domain);
|
||||
}
|
||||
return compareOptionalText(left.domain, right.domain) || compareText(left.url, right.url);
|
||||
});
|
||||
}
|
||||
|
||||
export function sortAssociatedProfiles(
|
||||
items: (AssociatedProfileSummary | BookmarkAssociatedProfileSummary)[],
|
||||
sortKey: AssociatedProfileSortKey,
|
||||
|
||||
Reference in New Issue
Block a user