diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-05-09 21:36:24 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-05-09 21:36:24 -0500 |
| commit | 95484c09dfc9e1e7ad982bb38b349ee4bf45f48b (patch) | |
| tree | 4f63d81ca37c9be6df868834a17551e7111281f7 /src/web | |
| parent | 305f41dcf74c848dbea4bfd7b0007451db0acc15 (diff) | |
| download | slskd-95484c09dfc9e1e7ad982bb38b349ee4bf45f48b.tar.gz | |
fault tolerance
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/components/Search/List/SearchListRow.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/web/src/components/Search/List/SearchListRow.js b/src/web/src/components/Search/List/SearchListRow.js index efac68a7..90648dae 100644 --- a/src/web/src/components/Search/List/SearchListRow.js +++ b/src/web/src/components/Search/List/SearchListRow.js @@ -1,25 +1,32 @@ import React, { useState } from 'react'; + import { Link, useRouteMatch, } from "react-router-dom"; -import SearchStatusIcon from './SearchStatusIcon'; -import SearchActionIcon from './SearchActionIcon'; - import { Table, Icon, } from 'semantic-ui-react'; +import SearchStatusIcon from './SearchStatusIcon'; +import SearchActionIcon from './SearchActionIcon'; + const SearchListRow = ({ search, onRemove, onStop }) => { const [working, setWorking] = useState(false); const match = useRouteMatch(); const invoke = async (func) => { setWorking(true); - await func(); - setWorking(false); + + try { + await func(); + } catch (error) { + console.error(error); + } finally { + setWorking(false); + } } return ( |
