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
20363ac5c8
commit
4029d35b71
@ -292,7 +292,7 @@ let ReadingListUI = {
|
|||||||
if (!uri)
|
if (!uri)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let item = yield ReadingList.getItemForURL(uri);
|
let item = yield ReadingList.itemForURL(uri);
|
||||||
if (item) {
|
if (item) {
|
||||||
yield item.delete();
|
yield item.delete();
|
||||||
} else {
|
} else {
|
||||||
|
@ -320,7 +320,7 @@ ReadingListImpl.prototype = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (metadata.previews.length > 0) {
|
if (metadata.previews.length > 0) {
|
||||||
itemData.preview = metadata.previews[0];
|
record.preview = metadata.previews[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return (yield this.addItem(record));
|
return (yield this.addItem(record));
|
||||||
@ -851,18 +851,20 @@ ReadingListItemIterator.prototype = {
|
|||||||
* @return The new normalized record.
|
* @return The new normalized record.
|
||||||
*/
|
*/
|
||||||
function normalizeRecord(nonNormalizedRecord) {
|
function normalizeRecord(nonNormalizedRecord) {
|
||||||
|
let record = {};
|
||||||
for (let prop in nonNormalizedRecord) {
|
for (let prop in nonNormalizedRecord) {
|
||||||
if (!ITEM_RECORD_PROPERTIES.includes(prop)) {
|
if (!ITEM_RECORD_PROPERTIES.includes(prop)) {
|
||||||
throw new Error("Unrecognized item property: " + prop);
|
throw new Error("Unrecognized item property: " + prop);
|
||||||
}
|
}
|
||||||
}
|
switch (prop) {
|
||||||
|
case "url":
|
||||||
let record = clone(nonNormalizedRecord);
|
case "resolvedURL":
|
||||||
if (record.url) {
|
record[prop] = normalizeURI(nonNormalizedRecord[prop]).spec;
|
||||||
record.url = normalizeURI(record.url).spec;
|
break;
|
||||||
}
|
default:
|
||||||
if (record.resolvedURL) {
|
record[prop] = nonNormalizedRecord[prop];
|
||||||
record.resolvedURL = normalizeURI(record.resolvedURL).spec;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user