fix: Multiple servers run on the same origin override the others IndexedDB (#28147)

Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
pull/30199/head
Cuong Huu Nguyen 3 years ago committed by GitHub
parent 070a05e91b
commit d107acfc5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts

@ -6,6 +6,7 @@ import { Mongo } from 'meteor/mongo';
import { ReactiveVar } from 'meteor/reactive-var';
import type { MinimongoCollection } from '../../../../client/definitions/MinimongoCollection';
import { baseURI } from '../../../../client/lib/baseURI';
import { getConfig } from '../../../../client/lib/utils/getConfig';
import { isTruthy } from '../../../../lib/isTruthy';
import { withDebouncing } from '../../../../lib/utils/highOrderFunctions';
@ -34,6 +35,10 @@ const hasUnserializedUpdatedAt = <T>(record: T): record is T & { _updatedAt: Con
'_updatedAt' in record &&
!((record as unknown as { _updatedAt: unknown })._updatedAt instanceof Date);
localforage.config({
name: baseURI,
});
export class CachedCollection<T extends { _id: string }, U = T> extends Emitter<{ changed: T; removed: T }> {
private static MAX_CACHE_TIME = 60 * 60 * 24 * 30;

Loading…
Cancel
Save