forked from cory/tildefriends
prettier
This commit is contained in:
parent
799f22e989
commit
35656a5c34
@ -167,16 +167,23 @@ class TfElement extends LitElement {
|
|||||||
if (ids.indexOf(id) == -1) {
|
if (ids.indexOf(id) == -1) {
|
||||||
delete cache.about[id];
|
delete cache.about[id];
|
||||||
} else {
|
} else {
|
||||||
users[id] = Object.assign(
|
users[id] = Object.assign(users[id] || {}, cache.about[id]);
|
||||||
users[id] || {},
|
}
|
||||||
cache.about[id]
|
}
|
||||||
|
|
||||||
|
let ids_out_of_date = ids.filter(
|
||||||
|
(x) =>
|
||||||
|
cache.about[x]?.seq === undefined ||
|
||||||
|
(users[x]?.seq && users[x]?.seq > cache.about[x].seq)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let ids_out_of_date = ids.filter(x => cache.about[x]?.seq === undefined || (users[x]?.seq && users[x]?.seq > cache.about[x].seq));
|
console.log(
|
||||||
|
'loading about for',
|
||||||
console.log('loading about for', ids.length, 'accounts', ids_out_of_date.length, 'out of date');
|
ids.length,
|
||||||
|
'accounts',
|
||||||
|
ids_out_of_date.length,
|
||||||
|
'out of date'
|
||||||
|
);
|
||||||
if (ids_out_of_date.length) {
|
if (ids_out_of_date.length) {
|
||||||
try {
|
try {
|
||||||
let rows = await tfrpc.rpc.query(
|
let rows = await tfrpc.rpc.query(
|
||||||
@ -219,7 +226,7 @@ class TfElement extends LitElement {
|
|||||||
if (!cache.about[id]?.seq) {
|
if (!cache.about[id]?.seq) {
|
||||||
cache.about[id] = {seq: users[id]?.seq ?? 0};
|
cache.about[id] = {seq: users[id]?.seq ?? 0};
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
let new_cache = JSON.stringify(cache);
|
let new_cache = JSON.stringify(cache);
|
||||||
if (new_cache != original_cache) {
|
if (new_cache != original_cache) {
|
||||||
|
@ -246,8 +246,7 @@ class TfProfileElement extends LitElement {
|
|||||||
if (typeof image == 'string' && !image.startsWith('&')) {
|
if (typeof image == 'string' && !image.startsWith('&')) {
|
||||||
try {
|
try {
|
||||||
image = JSON.parse(image)?.link;
|
image = JSON.parse(image)?.link;
|
||||||
} catch {
|
} catch {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
image = this.editing?.image ?? image;
|
image = this.editing?.image ?? image;
|
||||||
let description = this.editing?.description ?? profile.description;
|
let description = this.editing?.description ?? profile.description;
|
||||||
|
@ -41,8 +41,7 @@ class TfUserElement extends LitElement {
|
|||||||
if (typeof image_link == 'string' && !image_link.startsWith('&')) {
|
if (typeof image_link == 'string' && !image_link.startsWith('&')) {
|
||||||
try {
|
try {
|
||||||
image_link = JSON.parse(image_link)?.link;
|
image_link = JSON.parse(image_link)?.link;
|
||||||
} catch {
|
} catch {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (image_link !== undefined) {
|
if (image_link !== undefined) {
|
||||||
image = html`<img
|
image = html`<img
|
||||||
|
Loading…
x
Reference in New Issue
Block a user