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(sentry): SKFP-1360 fix empty value in highlight search #4165

Merged
merged 3 commits into from
Nov 14, 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
2 changes: 1 addition & 1 deletion src/components/uiKit/search/GlobalSearch/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isEmpty } from 'lodash';

export const highlightSearchMatch = (value: string, matchRegex: RegExp, search: string) => {
const result = !isEmpty(search) && value.search(matchRegex) >= 0;
const result = !isEmpty(search) && !isEmpty(value) && value.search(matchRegex) >= 0;

return result ? (
<span
Expand Down
2 changes: 1 addition & 1 deletion src/store/fences/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const fenceOpenAuhentificationTab = createAsyncThunk<

return new Promise((resolve, reject) => {
const interval = setInterval(async () => {
if (authWindow.closed) {
if (authWindow?.closed) {
const { data } = await FenceApi.isAuthenticated(fence);

if (data?.authenticated) {
Expand Down
2 changes: 1 addition & 1 deletion src/store/passport/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const connectCavaticaPassport = createAsyncThunk<

return new Promise((resolve, reject) => {
const interval = setInterval(async () => {
if (authWindow.closed) {
if (authWindow?.closed) {
await thunkAPI.dispatch(fetchCavaticaAuthentificationStatus());
const {
passport: {
Expand Down
Loading