Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #416 from shocknet/share-posts-fixes
Browse files Browse the repository at this point in the history
Share posts fixes
  • Loading branch information
Daniel Lugo authored Nov 25, 2020
2 parents a2869aa + 4280806 commit 7f5d07d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/store/sagas/shared-posts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventChannel, END, EventChannel } from 'redux-saga'
import { eventChannel, END, EventChannel, buffers } from 'redux-saga'
import {
takeEvery,
select,
Expand Down Expand Up @@ -35,15 +35,11 @@ const handleShockEvent = (
pickBy(data, v => v !== null),
).filter(k => k !== '_')

console.log(sharedPostsReceived)

const sharedPostsDeleted = Object.keys(
// get deleted sharedPosts
pickBy(data, v => v == null),
).filter(k => k !== '_')

console.log(sharedPostsDeleted)

if (size(sharedPostsDeleted)) {
emit(
Actions.removedSeveralSharedPosts(
Expand Down Expand Up @@ -116,7 +112,7 @@ function createSocketChannel(
socket.off('*')
socket.close()
}
})
}, buffers.expanding(10))
}

function* handlePublicKeySocket(chan: EventChannel<RelevantAction>) {
Expand Down Expand Up @@ -174,6 +170,7 @@ function* watchSharedPosts() {

yield cancel(task)
}
publicKeysWithSockets.clear()
}
} catch (e) {
Logger.log(`Error inside watchSharedPosts*()`)
Expand Down

0 comments on commit 7f5d07d

Please sign in to comment.