fix table editor permissions state (#36802)

* Switch to async permissions for table editor

* Add debugging

* More debug

* Snap debug

* Snap debug again

* Snap debug again, again

* One more

* Remove debugging

* Cleanup

* Split the useEffect into two.

* Add a setter for editable.

* Revert unneeded change.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
This commit is contained in:
Terry SuttonandIvan Vasilov authored and GitHub committed 2025-07-02 23:00:27 +02:00
1 parent 1ef8985822
commit 1aeb6eaec6
1 file changed
+9
+9
View File
@@ -141,6 +141,9 @@ export const createTableEditorTableState = ({
},
editable,
setEditable: (editable: boolean) => {
state.editable = editable
},
})
return state
@@ -203,6 +206,12 @@ export const TableEditorTableStateContextProvider = ({
}
}, [table])
useEffect(() => {
if (state.editable !== props.editable) {
state.setEditable(props.editable ?? true)
}
}, [props.editable, state])
return (
<TableEditorTableStateContext.Provider value={state}>
{children}