Skip to content

Commit

Permalink
no_action_buittons_on_refresh_content_page
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelKova committed Aug 7, 2024
1 parent 0971aba commit 0492465
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion apps/sensenet/src/components/editor/text-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PathHelper } from '@sensenet/client-utils'
import { ActionModel, GenericContent, Settings, File as SnFile } from '@sensenet/default-content-types'
import { useLogger, useRepository } from '@sensenet/hooks-react'
import React, { useEffect, useState } from 'react'
import { useLocalization } from '../../hooks'
import { useLocalization, useSelectionService } from '../../hooks'
import { getMonacoLanguage } from '../../services/content-context-service'
import { ContentBreadcrumbs } from '../ContentBreadcrumbs'
import { FullScreenLoader } from '../full-screen-loader'
Expand Down Expand Up @@ -50,6 +50,11 @@ export const TextEditor: React.FunctionComponent<TextEditorProps> = (props) => {
const [hasChanges, setHasChanges] = useState(false)
const logger = useLogger('TextEditor')
const [error, setError] = useState<Error | undefined>()
const selectionService = useSelectionService()

useEffect(() => {
selectionService.selection.setValue([props.content])
}, [props, selectionService.selection])

const saveContent = async () => {
try {
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/view-controls/browse-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ export const BrowseView: React.FC<BrowseViewProps> = (props) => {
})
setContent(expanedContentResponse.d)
selectionService.activeContent.setValue(expanedContentResponse.d)
selectionService.selection.setValue([expanedContentResponse.d])
}
getExpandedContent()
}, [repository, props.contentPath, selectionService.activeContent])
}, [repository, props.contentPath, selectionService.activeContent, selectionService.selection])

if (content === undefined) {
return null
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/view-controls/edit-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ export const EditView: React.FC<EditViewProps> = (props) => {
})
setContent(expanedContentResponse.d)
selectionService.activeContent.setValue(expanedContentResponse.d)
selectionService.selection.setValue([expanedContentResponse.d])
}
getExpandedContent()
}, [repository, props.contentPath, selectionService.activeContent])
}, [repository, props.contentPath, selectionService.activeContent, selectionService.selection])

if (content === undefined) {
return null
Expand Down

0 comments on commit 0492465

Please sign in to comment.