Skip to content

Commit 3c8c792

Browse files
committed
streams: Display error if stream update fails.
Displays a toast containing an error string if a call to updateExistingStream returns a failed promise. Fixes: #5286
1 parent 11cbbd1 commit 3c8c792

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/streams/EditStreamScreen.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as NavigationService from '../nav/NavigationService';
88
import { useSelector, useDispatch } from '../react-redux';
99
import { updateExistingStream, navigateBack } from '../actions';
1010
import { getStreamForId } from '../selectors';
11+
import { showToast } from '../utils/info';
1112
import Screen from '../common/Screen';
1213
import EditStreamCard from './EditStreamCard';
1314

@@ -22,7 +23,11 @@ export default function EditStreamScreen(props: Props): Node {
2223

2324
const handleComplete = useCallback(
2425
(name: string, description: string, isPrivate: boolean) => {
25-
dispatch(updateExistingStream(stream.stream_id, stream, { name, description, isPrivate }));
26+
dispatch(
27+
updateExistingStream(stream.stream_id, stream, { name, description, isPrivate }),
28+
).catch(error => {
29+
showToast(error.message);
30+
});
2631
NavigationService.dispatch(navigateBack());
2732
},
2833
[stream, dispatch],

0 commit comments

Comments
 (0)