fix: prevent keypress actions in the loading state (#4462)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
@@ -69,6 +69,10 @@ watch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const addNewCollection = () => {
|
const addNewCollection = () => {
|
||||||
|
if (props.loadingState) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!editingName.value) {
|
if (!editingName.value) {
|
||||||
toast.error(t("collection.invalid_name"))
|
toast.error(t("collection.invalid_name"))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -69,10 +69,15 @@ watch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const addFolder = () => {
|
const addFolder = () => {
|
||||||
|
if (props.loadingState) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (editingName.value.trim() === "") {
|
if (editingName.value.trim() === "") {
|
||||||
toast.error(t("folder.invalid_name"))
|
toast.error(t("folder.invalid_name"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
emit("add-folder", editingName.value)
|
emit("add-folder", editingName.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,10 +166,15 @@ watch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const addRequest = () => {
|
const addRequest = () => {
|
||||||
|
if (props.loadingState) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (editingName.value.trim() === "") {
|
if (editingName.value.trim() === "") {
|
||||||
toast.error(`${t("error.empty_req_name")}`)
|
toast.error(`${t("error.empty_req_name")}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
emit("add-request", editingName.value)
|
emit("add-request", editingName.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ watch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const saveCollection = () => {
|
const saveCollection = () => {
|
||||||
|
if (props.loadingState) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (editingName.value.trim() === "") {
|
if (editingName.value.trim() === "") {
|
||||||
toast.error(t("collection.invalid_name"))
|
toast.error(t("collection.invalid_name"))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ watch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const editFolder = () => {
|
const editFolder = () => {
|
||||||
|
if (props.loadingState) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (editingName.value.trim() === "") {
|
if (editingName.value.trim() === "") {
|
||||||
toast.error(t("folder.invalid_name"))
|
toast.error(t("folder.invalid_name"))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -154,6 +154,10 @@ const submittedFeedback = ref(false)
|
|||||||
const { submitFeedback, isSubmitFeedbackPending } = useSubmitFeedback()
|
const { submitFeedback, isSubmitFeedbackPending } = useSubmitFeedback()
|
||||||
|
|
||||||
const editRequest = () => {
|
const editRequest = () => {
|
||||||
|
if (props.loadingState) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (editingName.value.trim() === "") {
|
if (editingName.value.trim() === "") {
|
||||||
toast.error(t("request.invalid_name"))
|
toast.error(t("request.invalid_name"))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -352,6 +352,10 @@ const removeEnvironmentVariable = (id: number) => {
|
|||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
|
|
||||||
const saveEnvironment = async () => {
|
const saveEnvironment = async () => {
|
||||||
|
if (isLoading.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
|
|
||||||
if (!editingName.value) {
|
if (!editingName.value) {
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ const isLoading = ref(false)
|
|||||||
const workspaceService = useService(WorkspaceService)
|
const workspaceService = useService(WorkspaceService)
|
||||||
|
|
||||||
const addNewTeam = async () => {
|
const addNewTeam = async () => {
|
||||||
|
if (isLoading.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
await pipe(
|
await pipe(
|
||||||
TeamNameCodec.decode(editingName.value),
|
TeamNameCodec.decode(editingName.value),
|
||||||
|
|||||||
Reference in New Issue
Block a user