mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1131416 - Desktop syncing module for reading list service (fixes to prepatory changes). rs=jaws
rs=jaws IRL
This commit is contained in:
parent
1ae12482da
commit
6aaf28f482
@ -292,7 +292,7 @@ let ReadingListUI = {
|
||||
if (!uri)
|
||||
return;
|
||||
|
||||
let item = yield ReadingList.getItemForURL(uri);
|
||||
let item = yield ReadingList.itemForURL(uri);
|
||||
if (item) {
|
||||
yield item.delete();
|
||||
} else {
|
||||
|
@ -320,7 +320,7 @@ ReadingListImpl.prototype = {
|
||||
};
|
||||
|
||||
if (metadata.previews.length > 0) {
|
||||
itemData.preview = metadata.previews[0];
|
||||
record.preview = metadata.previews[0];
|
||||
}
|
||||
|
||||
return (yield this.addItem(record));
|
||||
@ -851,18 +851,20 @@ ReadingListItemIterator.prototype = {
|
||||
* @return The new normalized record.
|
||||
*/
|
||||
function normalizeRecord(nonNormalizedRecord) {
|
||||
let record = {};
|
||||
for (let prop in nonNormalizedRecord) {
|
||||
if (!ITEM_RECORD_PROPERTIES.includes(prop)) {
|
||||
throw new Error("Unrecognized item property: " + prop);
|
||||
}
|
||||
}
|
||||
|
||||
let record = clone(nonNormalizedRecord);
|
||||
if (record.url) {
|
||||
record.url = normalizeURI(record.url).spec;
|
||||
}
|
||||
if (record.resolvedURL) {
|
||||
record.resolvedURL = normalizeURI(record.resolvedURL).spec;
|
||||
switch (prop) {
|
||||
case "url":
|
||||
case "resolvedURL":
|
||||
record[prop] = normalizeURI(nonNormalizedRecord[prop]).spec;
|
||||
break;
|
||||
default:
|
||||
record[prop] = nonNormalizedRecord[prop];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user