mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-09 07:16:03 +00:00
Ensure new data are fetched properly whenever history is opened (#12577)
GitOrigin-RevId: e0ae14cdc90c95dbd44b12bd8332bc982ea34a10
This commit is contained in:
parent
f03b75e55f
commit
3f992f9453
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 />
|
||||
|
|
Loading…
Add table
Reference in a new issue