aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-05-17 21:33:00 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-05-17 21:33:00 -0500
commit3d8deea832de8c04e9d85dc17efd125df5000a1f (patch)
tree6b2a83e1fab6531a8dfddc7b05ef9b68e3241257 /src
parent2de400676d742980e2ef9c889e3f47db647f8c24 (diff)
downloadslskd-3d8deea832de8c04e9d85dc17efd125df5000a1f.tar.gz
toast on error
Diffstat (limited to 'src')
-rw-r--r--src/web/src/components/Search/Searches.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/web/src/components/Search/Searches.js b/src/web/src/components/Search/Searches.js
index b21f62b6..c1a3a893 100644
--- a/src/web/src/components/Search/Searches.js
+++ b/src/web/src/components/Search/Searches.js
@@ -1,6 +1,7 @@
import React, { useState, useEffect, useRef } from 'react';
import { v4 as uuidv4 } from 'uuid';
import { useParams, useHistory, useRouteMatch } from 'react-router-dom';
+import { toast } from 'react-toastify';
import * as lib from '../../lib/searches';
import { createSearchHubConnection } from '../../lib/hubFactory';
@@ -78,6 +79,7 @@ const Searches = () => {
onConnecting();
await searchHub.start();
} catch (error) {
+ toast.error(error?.message ?? 'Failed to connect');
onConnectionError(error?.message ?? 'Failed to connect')
}
}
@@ -112,7 +114,8 @@ const Searches = () => {
history.push(`${match.url.replace(`/${searchId}`, '')}/${id}`);
}
} catch (error) {
- console.error(error)
+ console.error(error)
+ toast.error(error?.response?.data ?? error?.message ?? error);
setCreating(false)
}
}
@@ -131,6 +134,7 @@ const Searches = () => {
setRemoving(false);
} catch (err) {
console.error(err);
+ toast.error(error?.response?.data ?? error?.message ?? error);
setRemoving(false);
}
};
@@ -143,6 +147,7 @@ const Searches = () => {
setStopping(false);
} catch (error) {
console.error(error);
+ toast.error(error?.response?.data ?? error?.message ?? error);
setStopping(false);
}
}