From 5e07cdaaf0aa37298a5ed72a35519d21c9be6069 Mon Sep 17 00:00:00 2001 From: Joffrey BION Date: Sun, 28 May 2017 22:18:26 +0200 Subject: Remove error history from the state --- frontend/src/models/errors.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 frontend/src/models/errors.js (limited to 'frontend/src/models/errors.js') diff --git a/frontend/src/models/errors.js b/frontend/src/models/errors.js deleted file mode 100644 index c00954cd..00000000 --- a/frontend/src/models/errors.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Record, List } from 'immutable'; - -const ErrorsRecord = Record({ - nextId: 0, - history: new List(), -}); - -export default class ErrorsState extends ErrorsRecord { - addError(error) { - const errorObject = new Error({ id: this.nextId, error: new ErrorBag(error) }); - return this.set('history', this.history.push(errorObject)).set('nextId', this.nextId + 1); - } -} - -const ErrorRecord = Record({ - id: -1, - timestamp: new Date(), - error: new ErrorsRecord(), -}); - -export class Error extends ErrorRecord {} - -const ErrorBagRecord = Record({ - type: '', - position: 'bottom-left', - options: { - icon: 'error', - removeOnHover: true, - showCloseButton: true, - }, - title: 'Unknown Error', -}); - -export class ErrorBag extends ErrorBagRecord {} -- cgit