File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/components/newtab/workflow/edit Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,21 @@ const state = shallowReactive({
287287
288288const checkPermission = debounce (async (value ) => {
289289 try {
290+ if (! value .trim ()) {
291+ toast .error (' Spreadsheet id is empty' );
292+ return ;
293+ }
294+
295+ if (
296+ value .includes (' ://' ) ||
297+ value .startsWith (' http' ) ||
298+ value .startsWith (' www.' ) ||
299+ value .includes (' docs.google.com' )
300+ ) {
301+ toast .error (' Spreadsheet id is invalid' );
302+ return ;
303+ }
304+
290305 if (state .lastSheetId === value) return ;
291306
292307 const response = await fetchApi (
@@ -313,7 +328,7 @@ async function previewData() {
313328 spreadsheetId: props .data .spreadsheetId ,
314329 };
315330
316- if (! props .data .spreadsheetId ) {
331+ if (! props .data .spreadsheetId . trim () ) {
317332 toast .error (
318333 props .googleDrive
319334 ? ' No spreadsheet is selected'
You can’t perform that action at this time.
0 commit comments