diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index 3f61ffc..0d2ed57 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -322,6 +322,9 @@ const ChannelsTable = () => { const res = await API.get( `/api/channel/?p=${startIdx}&page_size=${pageSize}&id_sort=${idSort}`, ); + if (res === undefined) { + return; + } const { success, message, data } = res.data; if (success) { if (startIdx === 0) { @@ -608,6 +611,9 @@ const ChannelsTable = () => { let res = await API.get(`/api/group/`); // add 'all' option // res.data.data.unshift('all'); + if (res === undefined) { + return; + } setGroupOptions( res.data.data.map((group) => ({ label: group, diff --git a/web/src/components/SiderBar.js b/web/src/components/SiderBar.js index e0b2ae3..96d7e7e 100644 --- a/web/src/components/SiderBar.js +++ b/web/src/components/SiderBar.js @@ -156,6 +156,9 @@ const SiderBar = () => { const loadStatus = async () => { const res = await API.get('/api/status'); + if (res === undefined) { + return; + } const { success, data } = res.data; if (success) { localStorage.setItem('status', JSON.stringify(data)); diff --git a/web/src/pages/Channel/EditChannel.js b/web/src/pages/Channel/EditChannel.js index ab0a373..9b98de2 100644 --- a/web/src/pages/Channel/EditChannel.js +++ b/web/src/pages/Channel/EditChannel.js @@ -188,6 +188,9 @@ const EditChannel = (props) => { const loadChannel = async () => { setLoading(true); let res = await API.get(`/api/channel/${channelId}`); + if (res === undefined) { + return; + } const { success, message, data } = res.data; if (success) { if (data.models === '') { @@ -223,6 +226,9 @@ const EditChannel = (props) => { const fetchModels = async () => { try { let res = await API.get(`/api/channel/models`); + if (res === undefined) { + return; + } let localModelOptions = res.data.data.map((model) => ({ label: model.id, value: model.id, @@ -244,6 +250,9 @@ const EditChannel = (props) => { const fetchGroups = async () => { try { let res = await API.get(`/api/group/`); + if (res === undefined) { + return; + } setGroupOptions( res.data.data.map((group) => ({ label: group,