mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-05 15:19:02 +02:00
Ensure new data are fetched properly whenever history is opened (#12577)
GitOrigin-RevId: e0ae14cdc90c95dbd44b12bd8332bc982ea34a10
This commit is contained in:
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user