Ensure new data are fetched properly whenever history is opened (#12577)

GitOrigin-RevId: e0ae14cdc90c95dbd44b12bd8332bc982ea34a10
This commit is contained in:
M Fahru
2023-04-12 10:40:42 -07:00
committed by Copybot
parent 1ff6730588
commit bf89bd0a97
2 changed files with 4 additions and 11 deletions
@@ -44,7 +44,9 @@ else
include ./editor
if (historyViewReact)
history-root
history-root(
ng-if="ui.view == 'history'"
)
else
include ./history
@@ -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 (
<HistoryProvider>
<Main />