mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-11 12:37:22 +01:00
Fetch event from server if not in storage
This commit is contained in:
parent
2501bad4b4
commit
57c4070505
@ -555,8 +555,13 @@ export class BaseRoom extends EventEmitter {
|
|||||||
const observable = this._observedEvents.observe(eventId, entry);
|
const observable = this._observedEvents.observe(eventId, entry);
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
// update in the background
|
// update in the background
|
||||||
this._readEventById(eventId).then(entry => {
|
this._readEventById(eventId).then(async entry => {
|
||||||
observable.update(entry);
|
if (entry) {
|
||||||
|
observable.update(entry);
|
||||||
|
} else {
|
||||||
|
const fectchedEntry = await this._fetchContext(eventId);
|
||||||
|
observable.update(fectchedEntry);
|
||||||
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.warn(`could not load event ${eventId} from storage`, err);
|
console.warn(`could not load event ${eventId} from storage`, err);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user