Skip to content

Commit

Permalink
Merge pull request #27 from TARAAI/u/bs/fix-timestamp
Browse files Browse the repository at this point in the history
fix: timestamp
  • Loading branch information
Bobby authored Dec 3, 2021
2 parents 6a239bb + 9e337ca commit 97d2db4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/reducers/cacheReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import {
isEmpty,
identity,
} from 'lodash';
import { Timestamp } from 'firebase/firestore';
import { actionTypes } from '../constants';
import { getBaseQueryName } from '../utils/query';
import mark from '../utils/profiling';
import { getFirestore } from '../createFirestoreInstance';

const info = debug('rrf:cache');
const verbose = debug('rrfVerbose:cache');
Expand Down Expand Up @@ -508,7 +508,8 @@ const arrayRemove = (key, val, cached) =>
const increment = (key, val, cached) =>
key === '::increment' && typeof val === 'number' && (cached() || 0) + val;

const serverTimestamp = (key) => key === '::serverTimestamp' && Timestamp.now();
const serverTimestamp = (key) =>
key === '::serverTimestamp' && getFirestore().Timestamp.now();

/**
* Process Mutation to a vanilla JSON
Expand Down

0 comments on commit 97d2db4

Please sign in to comment.