fix: history component crashing on special characters (fixes #2743)
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
/>
|
/>
|
||||||
</summary>
|
</summary>
|
||||||
<component
|
<component
|
||||||
:is="page == 'rest' ? HistoryRestCard : HistoryGraphqlCard"
|
:is="page === 'rest' ? HistoryRestCard : HistoryGraphqlCard"
|
||||||
v-for="(entry, index) in filteredHistoryGroup"
|
v-for="(entry, index) in filteredHistoryGroup"
|
||||||
:id="index"
|
:id="index"
|
||||||
:key="`entry-${index}`"
|
:key="`entry-${index}`"
|
||||||
@@ -122,7 +122,7 @@ import {
|
|||||||
isEqualHoppRESTRequest,
|
isEqualHoppRESTRequest,
|
||||||
safelyExtractRESTRequest,
|
safelyExtractRESTRequest,
|
||||||
} from "@hoppscotch/data"
|
} from "@hoppscotch/data"
|
||||||
import { groupBy } from "lodash-es"
|
import { groupBy, escapeRegExp } from "lodash-es"
|
||||||
import { useTimeAgo } from "@vueuse/core"
|
import { useTimeAgo } from "@vueuse/core"
|
||||||
import { pipe } from "fp-ts/function"
|
import { pipe } from "fp-ts/function"
|
||||||
import * as A from "fp-ts/Array"
|
import * as A from "fp-ts/Array"
|
||||||
@@ -213,7 +213,10 @@ const filteredHistory = computed(() =>
|
|||||||
return (
|
return (
|
||||||
!!input.updatedOn &&
|
!!input.updatedOn &&
|
||||||
(filterText.value.length === 0 ||
|
(filterText.value.length === 0 ||
|
||||||
deepCheckForRegex(input, new RegExp(filterText.value, "gi")))
|
deepCheckForRegex(
|
||||||
|
input,
|
||||||
|
new RegExp(escapeRegExp(filterText.value), "gi")
|
||||||
|
))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user