fix: cachedmetadata timestamp or existance check.

pull/2/head
fiatjaf 2020-11-18 09:04:41 -03:00
rodzic 0226a367ff
commit 98ed06dd45
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -56,7 +56,8 @@ export default {
} else if (context === 'history') {
// someone we follow, but an old update
db.cachedmetadata.get(event.pubkey).then(data => {
if (data.time < storeable.time) {
// only save if it's newer than what we have
if (!data || data.time < storeable.time) {
state.metadata.set(event.pubkey, meta)
db.cachedmetadata.put(storeable)
}