123
124
update(id: number, patch: { url?: string; title?: string; faviconHash?: string | null }): boolean {
126
>
if (idx === -1) {
127
return false;
128
}
129
const existing = this._items[idx];
130
>
const nextTitle = patch.title && patch.title.length > 0 ? patch.title : existing.title;
browserHistory.ts
131
>
const nextUrl = patch.url && patch.url.length > 0 ? patch.url : existing.url;
132
>
// Distinguish "leave alone" (undefined) from explicit clear (null).
133
>
const nextFaviconHash = patch.faviconHash === undefined
134
? existing.icon
135
: (patch.faviconHash ?? undefined);
137
>
const nextTime = patch.url ? Date.now() : existing.time;
138
>
if (nextUrl === existing.url && nextTitle === existing.title && nextFaviconHash === existing.icon && nextTime === existing.time) {
139
return false;
140
}