Guard against empty error messages

This commit is contained in:
Tom Moor
2019-03-02 21:17:26 -08:00
parent 67ed017122
commit 8b639682ff

View File

@@ -88,6 +88,8 @@ class UiStore {
message: string,
type?: 'warning' | 'error' | 'info' | 'success' = 'success'
) => {
if (!message) return;
const id = v4();
const createdAt = new Date().toISOString();
this.toasts.set(id, { message, type, createdAt, id });