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

Share posts fixes #416

Merged
merged 2 commits into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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