Просмотр исходного кода

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

GitOrigin-RevId: e0ae14cdc90c95dbd44b12bd8332bc982ea34a10
M Fahru 3 лет назад
Родитель
Сommit
3f992f9453

+ 3 - 1
services/web/app/views/project/editor/main.pug

@@ -44,7 +44,9 @@ else
 				include ./editor
 				include ./editor
 
 
 				if (historyViewReact)
 				if (historyViewReact)
-					history-root
+					history-root(
+						ng-if="ui.view == 'history'"
+					)
 				else
 				else
 					include ./history
 					include ./history
 
 

+ 1 - 10
services/web/frontend/js/features/history/components/history-root.tsx

@@ -1,18 +1,15 @@
 import ChangeList from './change-list/change-list'
 import ChangeList from './change-list/change-list'
 import DiffView from './diff-view/diff-view'
 import DiffView from './diff-view/diff-view'
-import { useLayoutContext } from '../../../shared/context/layout-context'
 import { HistoryProvider, useHistoryContext } from '../context/history-context'
 import { HistoryProvider, useHistoryContext } from '../context/history-context'
 import { createPortal } from 'react-dom'
 import { createPortal } from 'react-dom'
 import HistoryFileTree from './history-file-tree'
 import HistoryFileTree from './history-file-tree'
-import getMeta from '../../../utils/meta'
 
 
 const fileTreeContainer = document.getElementById('history-file-tree')
 const fileTreeContainer = document.getElementById('history-file-tree')
 
 
 function Main() {
 function Main() {
-  const { view } = useLayoutContext()
   const { updates } = useHistoryContext()
   const { updates } = useHistoryContext()
 
 
-  if (view !== 'history' || updates.length === 0) {
+  if (updates.length === 0) {
     return null
     return null
   }
   }
 
 
@@ -30,12 +27,6 @@ function Main() {
 }
 }
 
 
 export default function HistoryRoot() {
 export default function HistoryRoot() {
-  const isReact = getMeta('ol-splitTestVariants')?.['history-view'] === 'react'
-
-  if (!isReact) {
-    return null
-  }
-
   return (
   return (
     <HistoryProvider>
     <HistoryProvider>
       <Main />
       <Main />