Skip to content

Commit 5bcafc8

Browse files
Merge pull request #117 from blackjackkent/100ThreadWarning
Remove pop up notification for more than 100 threads
2 parents be5aa36 + 35752a1 commit 5bcafc8

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

src/infrastructure/sagas/__tests__/toastrSaga.spec.js

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,6 @@ beforeEach(() => {
1717
jest.resetAllMocks();
1818
});
1919
describe('saga behavior', () => {
20-
describe('FETCHED_ACTIVE_THREADS_SUCCESS', () => {
21-
it('should display a warning if user has over 100 threads', () => {
22-
const threads = [];
23-
for (let i = 0; i < 101; i++) {
24-
threads.push({});
25-
}
26-
const action = {
27-
type: actions.FETCHED_ACTIVE_THREADS_SUCCESS,
28-
data: { threads }
29-
};
30-
const saga = new SagaTestWrapper(toastrSaga);
31-
return saga.execute(action)
32-
.then(() => {
33-
expect(toastr.light).toHaveBeenCalledTimes(1);
34-
expect(toastr.light).toHaveBeenLastCalledWith('Retrieving more than 100 threads; loading may take several minutes. Archive some threads to reduce loading time.', { status: 'info' });
35-
});
36-
});
37-
it('should display no warning if user has 100 threads or less', () => {
38-
const threads = [];
39-
for (let i = 0; i < 100; i++) {
40-
threads.push({});
41-
}
42-
const action = {
43-
type: actions.FETCHED_ACTIVE_THREADS_SUCCESS,
44-
data: { threads }
45-
};
46-
const saga = new SagaTestWrapper(toastrSaga);
47-
return saga.execute(action)
48-
.then(() => {
49-
expect(toastr.light).toHaveBeenCalledTimes(0);
50-
});
51-
});
52-
it('should display no warning if action has no data', () => {
53-
const action = {
54-
type: actions.FETCHED_ACTIVE_THREADS_SUCCESS,
55-
data: null
56-
};
57-
const saga = new SagaTestWrapper(toastrSaga);
58-
return saga.execute(action)
59-
.then(() => {
60-
expect(toastr.light).toHaveBeenCalledTimes(0);
61-
});
62-
});
63-
});
6420
describe('UNTRACK_THREAD_SUCCESS', () => {
6521
it('should display success message', () => {
6622
const action = {

src/infrastructure/sagas/toastrSaga.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { takeEvery, all } from 'redux-saga/effects';
33
import { toastr } from 'react-redux-toastr';
44

55
import {
6-
FETCHED_ACTIVE_THREADS_SUCCESS,
76
UNTRACK_THREAD_SUCCESS,
87
UNTRACK_THREAD_FAILURE,
98
UPSERT_THREAD_FAILURE,
@@ -25,13 +24,6 @@ import {
2524
EXPORT_THREADS_FAILURE
2625
} from '../actions';
2726

28-
function* displayActiveThreadsCountMessage(action) {
29-
const threadData = action.data;
30-
if (threadData && threadData.threads && threadData.threads.length > 100) {
31-
toastr.light('Retrieving more than 100 threads; loading may take several minutes. Archive some threads to reduce loading time.', { status: 'info' });
32-
}
33-
}
34-
3527
function* displayUntrackThreadError() {
3628
toastr.error('There was a problem untracking your thread.');
3729
}
@@ -135,7 +127,6 @@ function* displayExportThreadsError() {
135127

136128
export default function* fetchActiveThreadsSaga() {
137129
yield all([
138-
takeEvery(FETCHED_ACTIVE_THREADS_SUCCESS, displayActiveThreadsCountMessage),
139130
takeEvery(UNTRACK_THREAD_SUCCESS, displayUntrackThreadSuccess),
140131
takeEvery(UNTRACK_THREAD_FAILURE, displayUntrackThreadError),
141132
takeEvery(UPSERT_THREAD_FAILURE, displayUpdateThreadError),

0 commit comments

Comments
 (0)