From 3f992f9453009dfebbeac9a5641fa32651512809 Mon Sep 17 00:00:00 2001 From: M Fahru Date: Wed, 12 Apr 2023 10:40:42 -0700 Subject: [PATCH] Ensure new data are fetched properly whenever history is opened (#12577) GitOrigin-RevId: e0ae14cdc90c95dbd44b12bd8332bc982ea34a10 --- services/web/app/views/project/editor/main.pug | 4 +++- .../js/features/history/components/history-root.tsx | 11 +---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/services/web/app/views/project/editor/main.pug b/services/web/app/views/project/editor/main.pug index 6995188e7f..408b71a94c 100644 --- a/services/web/app/views/project/editor/main.pug +++ b/services/web/app/views/project/editor/main.pug @@ -44,7 +44,9 @@ else include ./editor if (historyViewReact) - history-root + history-root( + ng-if="ui.view == 'history'" + ) else include ./history diff --git a/services/web/frontend/js/features/history/components/history-root.tsx b/services/web/frontend/js/features/history/components/history-root.tsx index 4cc81c11ac..0d46dbc542 100644 --- a/services/web/frontend/js/features/history/components/history-root.tsx +++ b/services/web/frontend/js/features/history/components/history-root.tsx @@ -1,18 +1,15 @@ import ChangeList from './change-list/change-list' import DiffView from './diff-view/diff-view' -import { useLayoutContext } from '../../../shared/context/layout-context' import { HistoryProvider, useHistoryContext } from '../context/history-context' import { createPortal } from 'react-dom' import HistoryFileTree from './history-file-tree' -import getMeta from '../../../utils/meta' const fileTreeContainer = document.getElementById('history-file-tree') function Main() { - const { view } = useLayoutContext() const { updates } = useHistoryContext() - if (view !== 'history' || updates.length === 0) { + if (updates.length === 0) { return null } @@ -30,12 +27,6 @@ function Main() { } export default function HistoryRoot() { - const isReact = getMeta('ol-splitTestVariants')?.['history-view'] === 'react' - - if (!isReact) { - return null - } - return (