diff options
author | Dessalines <tyhou13@gmx.com> | 2020-01-22 22:29:11 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-01-22 22:29:11 -0500 |
commit | 3b4258096c3c3dc160090436c9205e1ecf2e8e75 (patch) | |
tree | f07264d3de3b169c6140b2bf303ff7732d908b0a /ui/src/components/modlog.tsx | |
parent | 66af9623d90aadd47c9cf37faeac4f60f1d818d4 (diff) |
Adding a toaster to replace alerts. Fixes #457
Diffstat (limited to 'ui/src/components/modlog.tsx')
-rw-r--r-- | ui/src/components/modlog.tsx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/ui/src/components/modlog.tsx b/ui/src/components/modlog.tsx index 425710dd..6c35bce9 100644 --- a/ui/src/components/modlog.tsx +++ b/ui/src/components/modlog.tsx @@ -17,9 +17,9 @@ import { ModAdd, } from '../interfaces'; import { WebSocketService } from '../services'; -import { msgOp, addTypeInfo, fetchLimit } from '../utils'; +import { msgOp, addTypeInfo, fetchLimit, toast } from '../utils'; import { MomentTime } from './moment-time'; -import * as moment from 'moment'; +import moment from 'moment'; import { i18n } from '../i18next'; interface ModlogState { @@ -55,14 +55,7 @@ export class Modlog extends Component<any, ModlogState> { ? Number(this.props.match.params.community_id) : undefined; this.subscription = WebSocketService.Instance.subject - .pipe( - retryWhen(errors => - errors.pipe( - delay(3000), - take(10) - ) - ) - ) + .pipe(retryWhen(errors => errors.pipe(delay(3000), take(10)))) .subscribe( msg => this.parseMessage(msg), err => console.error(err), @@ -433,7 +426,7 @@ export class Modlog extends Component<any, ModlogState> { console.log(msg); let op: UserOperation = msgOp(msg); if (msg.error) { - alert(i18n.t(msg.error)); + toast(i18n.t(msg.error), 'danger'); return; } else if (op == UserOperation.GetModlog) { let res: GetModlogResponse = msg; |