This commit is contained in:
Jori Lallo
2017-10-21 19:39:13 -07:00
parent 30bb7bcde5
commit 0514090253
2 changed files with 0 additions and 11 deletions

View File

@@ -40,7 +40,6 @@ class Document extends BaseModel {
views: number;
data: Object;
fetchedAt: Date;
/* Computed */
@@ -102,10 +101,6 @@ class Document extends BaseModel {
: null;
}
get timeSinceFetch(): number {
return (new Date() - this.fetchedAt) / 1000;
}
/* Actions */
@action star = async () => {
@@ -250,7 +245,6 @@ class Document extends BaseModel {
if (dirty) this.hasPendingChanges = true;
this.data = data;
extendObservable(this, data);
this.fetchedAt = new Date();
}
constructor(data?: Object = {}) {

View File

@@ -116,11 +116,6 @@ class DocumentsStore extends BaseStore {
};
@action fetch = async (id: string, prefetch?: boolean): Promise<*> => {
/** If document has been fetched under 5s ago, return it */
const existingDocument = this.getById(id);
if (existingDocument && existingDocument.timeSinceFetch < 5)
return existingDocument;
if (!prefetch) this.isFetching = true;
try {