@@ -40,7 +40,9 @@ import {
4040} from '@netcracker/qubership-apihub-ui-shared/hooks/change-severities/useSeverityFiltersSearchParam'
4141import { GRAPH_VIEW_MODE } from '@netcracker/qubership-apihub-ui-shared/entities/operation-view-mode'
4242import { FILE_FORMAT_VIEW , YAML_FILE_VIEW_MODE } from '@netcracker/qubership-apihub-ui-shared/entities/file-format-view'
43- import { useOperationsPairAsStrings } from '@netcracker/qubership-apihub-ui-shared/hooks/operations/useOperationsPairAsStrings'
43+ import {
44+ useOperationsPairAsStrings ,
45+ } from '@netcracker/qubership-apihub-ui-shared/hooks/operations/useOperationsPairAsStrings'
4446import {
4547 useIsDocOperationViewMode ,
4648 useIsRawOperationViewMode ,
@@ -61,7 +63,10 @@ import type { OpenApiData } from '@apihub/entities/operation-structure'
6163import type { ApiType } from '@netcracker/qubership-apihub-ui-shared/entities/api-types'
6264import { API_TYPE_GRAPHQL , API_TYPE_REST } from '@netcracker/qubership-apihub-ui-shared/entities/api-types'
6365import { normalizeOpenApiDocument } from '@netcracker/qubership-apihub-ui-shared/utils/normalize'
64- import { useApiDiffResult , useIsApiDiffResultLoading } from '@apihub/routes/root/ApiDiffResultProvider'
66+ import {
67+ useApiDiffResult ,
68+ useIsApiDiffResultLoading , useSetApiDiffResult ,
69+ } from '@apihub/routes/root/ApiDiffResultProvider'
6570import { Toggler } from '@netcracker/qubership-apihub-ui-shared/components/Toggler'
6671import { RawSpecDiffView } from '@netcracker/qubership-apihub-ui-shared/components/RawSpecDiffView'
6772import { removeComponents } from '@netcracker/qubership-apihub-api-processor'
@@ -138,6 +143,7 @@ export const OperationContent: FC<OperationContentProps> = memo<OperationContent
138143
139144 const apiDiffResult = useApiDiffResult ( )
140145 const isApiDiffResultLoading = useIsApiDiffResultLoading ( )
146+ const setApiDiffResult = useSetApiDiffResult ( )
141147
142148 const mergedDocument = useMemo (
143149 ( ) => {
@@ -159,8 +165,14 @@ export const OperationContent: FC<OperationContentProps> = memo<OperationContent
159165 [ changedOperation ?. data , comparisonMode , originOperation ?. data , apiDiffResult ?. merged ] ,
160166 )
161167
168+ useEffect ( ( ) => {
169+ return ( ) => {
170+ setApiDiffResult ( undefined )
171+ }
172+ } , [ ] )
173+
162174 if ( isLoading || isApiDiffResultLoading ) {
163- operationContentElement = < LoadingIndicator />
175+ operationContentElement = < LoadingIndicator />
164176 } else if ( ! changedOperationContent && ! originOperationContent ) {
165177 return (
166178 < Placeholder
@@ -187,7 +199,7 @@ export const OperationContent: FC<OperationContentProps> = memo<OperationContent
187199 breadcrumbsData = { breadcrumbsData }
188200 actions = { isRawViewMode && rawViewActions }
189201 />
190- { isDocViewMode && (
202+ { isDocViewMode && ! ! mergedDocument && (
191203 < OperationView
192204 apiType = { apiType as ApiType }
193205 originOperation = { originOperation }
@@ -240,7 +252,7 @@ export const OperationContent: FC<OperationContentProps> = memo<OperationContent
240252 overflow = "scroll"
241253 >
242254 { ! ! rawViewActions && (
243- < OperationSubheader actions = { rawViewActions } />
255+ < OperationSubheader actions = { rawViewActions } />
244256 ) }
245257 < RawSpecView
246258 value = { changedValue }
0 commit comments