From 416ae4fc82cb989cfc37a52e4958ea1b6bfd0b39 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Tue, 15 Aug 2023 09:25:52 +0300 Subject: [PATCH] Fix changelogs crashing after removing 2fa option --- src/state/changeLogs/reducer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/state/changeLogs/reducer.js b/src/state/changeLogs/reducer.js index 0b1c9b6d5..ffa7a393c 100644 --- a/src/state/changeLogs/reducer.js +++ b/src/state/changeLogs/reducer.js @@ -4,6 +4,7 @@ import _get from 'lodash/get' import authTypes from 'state/auth/constants' import timeRangeTypes from 'state/timeRange/constants' import { fetch, fetchFail } from 'state/reducers.helper' +import _isString from 'lodash/isString' import types from './constants' @@ -37,12 +38,16 @@ export function changeLogsReducer(state = initialState, action) { userAgent, } = entry + const preparedUserAgent = _isString(userAgent) + ? userAgent + : userAgent?.raw + return { ip, log, mtsCreate, subUserId, - userAgent, + userAgent: preparedUserAgent, } })