Skip to content

Commit

Permalink
fix: Class Level Permissions dialog throws error `TypeError: ce.curre…
Browse files Browse the repository at this point in the history
…nt is null` for newly created class (#2549)
  • Loading branch information
devbymak authored Apr 30, 2024
1 parent 427bb3d commit 27ed692
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ class Browser extends DashboardView {
this.props.schema
.dispatch(ActionTypes.CREATE_CLASS, { className })
.then(() => {
this.state.clp[className] = this.props.schema.data.get('CLPs').toJS()[className];
this.state.counts[className] = 0;
this.props.navigate(generatePath(this.context, 'browser/' + className));
})
Expand All @@ -380,6 +381,7 @@ class Browser extends DashboardView {
this.props.schema.dispatch(ActionTypes.DROP_CLASS, { className }).then(
() => {
this.setState({ showDropClassDialog: false });
delete this.state.clp[className];
delete this.state.counts[className];
this.props.navigate(generatePath(this.context, 'browser'));
},
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Data/Browser/BrowserToolbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ const BrowserToolbar = ({
disabled={isPendingEditCloneRows}
/>
{onAddRow && <div className={styles.toolbarSeparator} />}
{perms && enableSecurityDialog ? (
{enableSecurityDialog ? (
<SecurityDialog
ref={clpDialogRef}
disabled={!!relation || !!isUnique}
Expand Down

0 comments on commit 27ed692

Please sign in to comment.