From e8dce60988a9bd66657b62b1e1d4892ba49ac282 Mon Sep 17 00:00:00 2001 From: JY Kim Date: Wed, 27 Nov 2024 11:18:02 +0900 Subject: [PATCH] Issue/8861 (#461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 중간 커밋 * 중간 커밋 * 8861 이슈 처리 * name 수정 * error 처리 보강 --------- Co-authored-by: usbsync --- .../popup/Contents/LoadWeb/index.jsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/popup/Contents/LoadWeb/index.jsx b/src/components/popup/Contents/LoadWeb/index.jsx index 241146c4..6b2829c1 100644 --- a/src/components/popup/Contents/LoadWeb/index.jsx +++ b/src/components/popup/Contents/LoadWeb/index.jsx @@ -39,16 +39,20 @@ const Index = ({ type, loadWeb, HeaderButtonPortal }) => { setSheetIdValid(null); - const response = await fetch( - // eslint-disable-next-line max-len - `https://docs.google.com/spreadsheets/d/${sheetId}/gviz/tq?tqx=out:csv&sheet=${sheetName}` - ); - if (response.status !== 200) { + try { + const response = await fetch( + // eslint-disable-next-line max-len + `https://docs.google.com/spreadsheets/d/${sheetId}/gviz/tq?tqx=out:csv&sheet=${sheetName}` + ); + if (response.status !== 200) { + setSheetIdValid(SheetIdValidMsg[1]); + return; + } + const csv = await response.text(); + loadWeb(csv); + } catch (e) { setSheetIdValid(SheetIdValidMsg[1]); - return; } - const csv = await response.text(); - loadWeb(csv); }; return (