The History PR: I - Move to redux (#1156)

This commit is contained in:
Erik Michelson 2021-04-22 22:46:24 +02:00 committed by GitHub
parent bba2b207c4
commit 8e5a667d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 629 additions and 417 deletions

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import i18n from 'i18next'
import { store } from '../index'
import {
DismissUiNotificationAction,
@ -37,3 +38,10 @@ export const dismissUiNotification = (notificationId: number): void => {
notificationId
} as DismissUiNotificationAction)
}
// Promises catch errors as any.
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-module-boundary-types
export const showErrorNotification = (message: string) => (error: any): void => {
console.error(message, error)
dispatchUiNotification(i18n.t('common.errorOccurred'), message, DEFAULT_DURATION_IN_SECONDS, 'exclamation-triangle')
}