mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
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:
1 parent
1ef8985822
commit
1aeb6eaec6
1 file changed
+9
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user