Bug 1643752 - Sort send tab targets by last used r=markh,vbudhram

Differential Revision: https://phabricator.services.mozilla.com/D134722
This commit is contained in:
Sammy Khamis 2022-01-27 19:14:35 +00:00
Родитель 6e1ba3994e
Коммит 3f6b2b72fc
3 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -419,7 +419,7 @@ var gSync = {
targets.push(d);
}
}
return targets.sort((a, b) => a.name.localeCompare(b.name));
return targets.sort((a, b) => b.lastAccessTime - a.lastAccessTime);
},
_definePrefGetters() {

Просмотреть файл

@ -10,16 +10,19 @@ const fxaDevices = [
id: 1,
name: "Foo",
availableCommands: { "https://identity.mozilla.com/cmd/open-uri": "baz" },
lastAccessTime: Date.now(),
},
{
id: 2,
name: "Bar",
availableCommands: { "https://identity.mozilla.com/cmd/open-uri": "boo" },
lastAccessTime: Date.now() + 60000, // add 30min
},
{
id: 3,
name: "Baz",
clientRecord: "bar",
lastAccessTime: Date.now() + 120000, // add 60min
}, // Legacy send tab target (no availableCommands).
{ id: 4, name: "Homer" }, // Incompatible target.
];

Просмотреть файл

@ -15,16 +15,19 @@ const fxaDevices = [
id: 1,
name: "Foo",
availableCommands: { "https://identity.mozilla.com/cmd/open-uri": "baz" },
lastAccessTime: Date.now(),
},
{
id: 2,
name: "Bar",
availableCommands: { "https://identity.mozilla.com/cmd/open-uri": "boo" },
lastAccessTime: Date.now() + 60000, // add 30min
},
{
id: 3,
name: "Baz",
clientRecord: "bar",
lastAccessTime: Date.now() + 120000, // add 60min
}, // Legacy send tab target (no availableCommands).
{ id: 4, name: "Homer" }, // Incompatible target.
];