1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 14:54:22 +00:00

🔧 Disable editing a notebook while it's locked or started

This commit is contained in:
Steffo 2021-10-15 17:06:07 +02:00 committed by Stefano Pigozzi
parent b9651b270b
commit 023041da36

View file

@ -15,7 +15,7 @@ export interface NotebookCreateBoxProps {
}
export function NotebookCreateBox({viewSet, resource}: NotebookCreateBoxProps): JSX.Element {
export function NotebookCreateBox({viewSet, resource}: NotebookCreateBoxProps): JSX.Element | null {
const authorization = useAuthorizationContext()
const project = useProjectContext()
@ -54,6 +54,15 @@ export function NotebookCreateBox({viewSet, resource}: NotebookCreateBoxProps):
[viewSet, resource],
)
if(resource) {
if(resource.value.locked_by) {
return null
}
if(resource.value.is_running) {
return null
}
}
return (
<Box>
<Details>