Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: request variable list item remove bug #4392

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ import {
changeCurrentReorderStatus,
currentReorderingStatus$,
} from "~/newstore/reordering"
import { platform } from "~/platform"
import IconCheckCircle from "~icons/lucide/check-circle"
import IconCopy from "~icons/lucide/copy"
import IconDownload from "~icons/lucide/download"
Expand Down Expand Up @@ -334,11 +333,6 @@ const currentReorderingStatus = useReadonlyStream(currentReorderingStatus$, {
parentID: "",
})

const currentUser = useReadonlyStream(
platform.auth.getCurrentUserStream(),
platform.auth.getCurrentUser()
)

// Used to determine if the collection is being dragged to a different destination
// This is used to make the highlight effect work
watch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,8 @@ import { useToast } from "@composables/toast"
import { HoppCollection } from "@hoppscotch/data"
import { useService } from "dioc/vue"
import { computed, ref } from "vue"
import { useReadonlyStream } from "~/composables/stream"
import { Picked } from "~/helpers/types/HoppPicked"
import { removeGraphqlCollection } from "~/newstore/collections"
import { platform } from "~/platform"
import { GQLTabService } from "~/services/tab/graphql"
import IconCheckCircle from "~icons/lucide/check-circle"
import IconCopy from "~icons/lucide/copy"
Expand Down Expand Up @@ -333,11 +331,6 @@ const dragging = ref(false)

const confirmRemove = ref(false)

const currentUser = useReadonlyStream(
platform.auth.getCurrentUserStream(),
platform.auth.getCurrentUser()
)

const isSelected = computed(
() =>
props.picked?.pickedType === "gql-my-collection" &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,8 @@ import { useToast } from "@composables/toast"
import { HoppCollection } from "@hoppscotch/data"
import { useService } from "dioc/vue"
import { computed, ref } from "vue"
import { useReadonlyStream } from "~/composables/stream"
import { Picked } from "~/helpers/types/HoppPicked"
import { removeGraphqlFolder } from "~/newstore/collections"
import { platform } from "~/platform"
import { GQLTabService } from "~/services/tab/graphql"
import IconCheckCircle from "~icons/lucide/check-circle"
import IconCopy from "~icons/lucide/copy"
Expand Down Expand Up @@ -297,11 +295,6 @@ const showChildren = ref(false)
const dragging = ref(false)
const confirmRemove = ref(false)

const currentUser = useReadonlyStream(
platform.auth.getCurrentUserStream(),
platform.auth.getCurrentUser()
)

const isSelected = computed(
() =>
props.picked?.pickedType === "gql-my-folder" &&
Expand Down
30 changes: 15 additions & 15 deletions packages/hoppscotch-common/src/components/http/RequestVariables.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,21 @@ const workingRequestVariables = ref<
},
])

// Rule: Working Request variable always have last element is always an empty param
watch(workingRequestVariables, (variableList) => {
if (
variableList.length > 0 &&
variableList[variableList.length - 1].key !== ""
) {
workingRequestVariables.value.push({
id: idTicker.value++,
key: "",
value: "",
active: true,
})
}
})

// Sync logic between params and working/bulk params
watch(
requestVariables,
Expand Down Expand Up @@ -324,21 +339,6 @@ watch(bulkVariables, (newBulkParams) => {
}
})

// Rule: Working Request variable always have last element is always an empty param
watch(workingRequestVariables, (variableList) => {
if (
variableList.length > 0 &&
variableList[variableList.length - 1].key !== ""
) {
workingRequestVariables.value.push({
id: idTicker.value++,
key: "",
value: "",
active: true,
})
}
})

const addVariable = () => {
workingRequestVariables.value.push({
id: idTicker.value++,
Expand Down