diff options
Diffstat (limited to 'frontend/src/sagas/errors.js')
-rw-r--r-- | frontend/src/sagas/errors.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/frontend/src/sagas/errors.js b/frontend/src/sagas/errors.js index 84bd044b..15287645 100644 --- a/frontend/src/sagas/errors.js +++ b/frontend/src/sagas/errors.js @@ -1,11 +1,13 @@ // @flow -import { toastr } from 'react-redux-toastr'; +import { Toaster } from '@blueprintjs/core'; import type { Channel, SagaIterator } from 'redux-saga'; import { eventChannel } from 'redux-saga'; import { apply, cancelled, take } from 'redux-saga/effects'; import type { ApiError } from '../api/model'; import type { SevenWondersSession } from '../api/sevenWondersApi'; +const ErrorToaster = Toaster.create(); + export function* errorHandlingSaga(session: SevenWondersSession): SagaIterator { const errorChannel: Channel = yield eventChannel(session.watchErrors()); try { @@ -24,7 +26,7 @@ export function* errorHandlingSaga(session: SevenWondersSession): SagaIterator { function* handleOneError(err: ApiError): * { console.error('Error received on web socket channel', err); const msg = buildMsg(err); - yield apply(toastr, toastr.error, [msg, { icon: 'error' }]); + yield apply(ErrorToaster, ErrorToaster.show, [{ intent: 'danger', icon: 'error', message: msg }]); } function buildMsg(err: ApiError): string { |