mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 23:04:21 +00:00
🔧 Disable editing a notebook while it's locked or started
This commit is contained in:
parent
b9651b270b
commit
023041da36
1 changed files with 10 additions and 1 deletions
|
@ -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 authorization = useAuthorizationContext()
|
||||||
const project = useProjectContext()
|
const project = useProjectContext()
|
||||||
|
|
||||||
|
@ -54,6 +54,15 @@ export function NotebookCreateBox({viewSet, resource}: NotebookCreateBoxProps):
|
||||||
[viewSet, resource],
|
[viewSet, resource],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(resource) {
|
||||||
|
if(resource.value.locked_by) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
if(resource.value.is_running) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Details>
|
<Details>
|
||||||
|
|
Loading…
Reference in a new issue