mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 11:21:41 +03:00
re-instantiating state for posts update as an experiment
This commit is contained in:
parent
13d031c563
commit
f68cb455db
@ -157,27 +157,20 @@ export const cacheReducer = (state:PostsCache, action) => {
|
||||
}
|
||||
|
||||
//update stat
|
||||
const data = Object.create(state.cachedData);
|
||||
data[filter] = {
|
||||
...cachedEntry,
|
||||
startAuthor : _posts[_posts.length - 1] && _posts[_posts.length - 1].author,
|
||||
startPermlink : _posts[_posts.length - 1] && _posts[_posts.length - 1].permlink,
|
||||
posts : _posts,
|
||||
}
|
||||
// cachedEntry.startAuthor = _posts[_posts.length - 1] && _posts[_posts.length - 1].author;
|
||||
// cachedEntry.startPermlink = _posts[_posts.length - 1] && _posts[_posts.length - 1].permlink;
|
||||
// cachedEntry.posts = _posts;
|
||||
|
||||
// state.cachedData[filter] = cachedEntry;
|
||||
cachedEntry.startAuthor = _posts[_posts.length - 1] && _posts[_posts.length - 1].author;
|
||||
cachedEntry.startPermlink = _posts[_posts.length - 1] && _posts[_posts.length - 1].permlink;
|
||||
cachedEntry.posts = _posts;
|
||||
|
||||
state.cachedData[filter] = cachedEntry;
|
||||
|
||||
state.cachedData = data
|
||||
//dispatch to redux
|
||||
// if (
|
||||
// filter === (state.selectedFilter !== 'feed' ? state.selectedFilter : state.currentSubFilter)
|
||||
// ) {
|
||||
// _setFeedPosts(_posts);
|
||||
// }
|
||||
return state;
|
||||
return Object.create(state);
|
||||
}
|
||||
|
||||
case CacheActions.RESET_CURRENT_FILTER_CACHE: {
|
||||
|
Loading…
Reference in New Issue
Block a user