fix: Subscribe only when needed

This commit is contained in:
Maksim Eltyshev
2023-01-05 15:03:06 +01:00
parent b955e933b2
commit 58eda7d555
10 changed files with 28 additions and 23 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ export function* fetchBoardByCurrentPath() {
tasks,
attachments,
},
} = yield call(request, api.getBoard, boardId));
} = yield call(request, api.getBoard, boardId, true));
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ import api from '../../../api';
import mergeRecords from '../../../utils/merge-records';
export function* fetchCore() {
const { item: user } = yield call(request, api.getCurrentUser);
const { item: user } = yield call(request, api.getCurrentUser, true);
const { items: users1 } = yield call(request, api.getUsers);
const {
@@ -62,7 +62,7 @@ export function* handleBoardMembershipCreate(boardMembership) {
if (isCurrentUser) {
let board2;
try {
({ item: board2 } = yield call(request, api.getBoard, boardMembership.boardId));
({ item: board2 } = yield call(request, api.getBoard, boardMembership.boardId, false));
} catch {
return;
}
+1 -1
View File
@@ -96,7 +96,7 @@ export function* fetchBoard(id) {
tasks,
attachments,
},
} = yield call(request, api.getBoard, id));
} = yield call(request, api.getBoard, id, true));
} catch (error) {
yield put(actions.fetchBoard.failure(id, error));
return;
+1 -1
View File
@@ -81,7 +81,7 @@ export function* handleLocationChange() {
tasks,
attachments,
},
} = yield call(request, api.getBoard, currentBoard.id));
} = yield call(request, api.getBoard, currentBoard.id, true));
} catch (error) {} // eslint-disable-line no-empty
}