fix(common): make cursorPosition field optional in HoppGQLDocument type (#4834)
This commit is contained in:
parent
6ce0fb8897
commit
f3840e4342
2 changed files with 5 additions and 3 deletions
|
|
@ -56,7 +56,7 @@ export type HoppGQLDocument = {
|
|||
/**
|
||||
* The cursor position in the document
|
||||
*/
|
||||
cursorPosition: number
|
||||
cursorPosition?: number
|
||||
|
||||
/**
|
||||
* Info about where this request should be saved.
|
||||
|
|
|
|||
|
|
@ -310,7 +310,9 @@ export function useQuery() {
|
|||
if (!currentTab) return
|
||||
|
||||
const currentQuery = currentTab.document.request.query || ""
|
||||
const selectedOperation = getOperation(currentTab.document.cursorPosition)
|
||||
const selectedOperation = getOperation(
|
||||
currentTab.document.cursorPosition || 0
|
||||
)
|
||||
const navItems = [...navStack.value, { name: item.name, def: item }]
|
||||
|
||||
const result = processOperation(
|
||||
|
|
@ -368,7 +370,7 @@ export function useQuery() {
|
|||
isArgument = false
|
||||
): boolean => {
|
||||
const operation = getOperation(
|
||||
tabs.currentActiveTab.value?.document.cursorPosition
|
||||
tabs.currentActiveTab.value?.document.cursorPosition || 0
|
||||
)
|
||||
if (!operation) return false
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue