File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/hoppscotch-common/src/components Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ import { TeamWorkspace } from "~/services/workspace.service"
154154import IconSparkle from " ~icons/lucide/sparkles"
155155import IconThumbsDown from " ~icons/lucide/thumbs-down"
156156import IconThumbsUp from " ~icons/lucide/thumbs-up"
157+ import { handleTokenValidation } from " ~/helpers/handleTokenValidation" ;
157158
158159const t = useI18n ()
159160const toast = useToast ()
@@ -312,6 +313,9 @@ const onSelect = (pickedVal: Picked | null) => {
312313}
313314
314315const saveRequestAs = async () => {
316+ const isValidToken = await handleTokenValidation ()
317+ if (! isValidToken ) return
318+
315319 if (! requestName .value ) {
316320 toast .error (` ${t (" error.empty_req_name" )} ` )
317321 return
Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ import { RESTTabService } from "~/services/tab/rest"
270270import { getMethodLabelColor } from " ~/helpers/rest/labelColoring"
271271import { WorkspaceService } from " ~/services/workspace.service"
272272import { KernelInterceptorService } from " ~/services/kernel-interceptor.service"
273+ import { handleTokenValidation } from " ~/helpers/handleTokenValidation" ;
273274
274275const t = useI18n ()
275276const interceptorService = useService (KernelInterceptorService )
@@ -514,7 +515,10 @@ const cycleDownMethod = () => {
514515 }
515516}
516517
517- const saveRequest = () => {
518+ const saveRequest = async () => {
519+ const isValidToken = await handleTokenValidation ()
520+ if (! isValidToken ) return
521+
518522 const saveCtx = tab .value .document .saveContext
519523
520524 if (! saveCtx ) {
You can’t perform that action at this time.
0 commit comments