Add missing new for records.

master
Tom Hacohen 7 years ago
parent 4f88ff6364
commit 6c4f077d0f

@ -181,7 +181,7 @@ export const entries = handleAction(
const journals = handleAction( const journals = handleAction(
fetchJournals, fetchJournals,
fetchTypeIdentityReducer, fetchTypeIdentityReducer,
JournalsFetchRecord(), new JournalsFetchRecord(),
); );
const fetchCount = handleAction( const fetchCount = handleAction(
@ -236,10 +236,10 @@ const entriesSerialize = (state: FetchType<EntriesData>) => {
const entriesDeserialize = (state: EteSync.EntryJson[]): FetchType<EntriesData> => { const entriesDeserialize = (state: EteSync.EntryJson[]): FetchType<EntriesData> => {
if (state === null) { if (state === null) {
return EntriesFetchRecord({value: null}); return new EntriesFetchRecord({value: null});
} }
return EntriesFetchRecord({value: List(state.map((x: any) => { return new EntriesFetchRecord({value: List(state.map((x: any) => {
let ret = new EteSync.Entry(); let ret = new EteSync.Entry();
ret.deserialize(x); ret.deserialize(x);
return ret; return ret;
@ -268,7 +268,7 @@ const cacheDeserialize = (state: any, key: string) => {
}); });
return Map(ret); return Map(ret);
} else if (key === 'journals') { } else if (key === 'journals') {
return JournalsFetchRecord({value: journalsDeserialize(state)}); return new JournalsFetchRecord({value: journalsDeserialize(state)});
} }
return state; return state;

Loading…
Cancel
Save