16848: Avoids showing API errors when the extra token creation fails.
[arvados-workbench2.git] / src / views-components / token-dialog / token-dialog.tsx
index ed155541e41edea8402cdb284696fbb8d0fd2ab0..063bb2a5ef99db6433a85e8474c34be0ff89387e 100644 (file)
@@ -73,6 +73,12 @@ export class TokenDialogComponent extends React.Component<TokenDialogProps> {
                 hideDuration: 2000,
                 kind: SnackbarKind.SUCCESS
             }));
+        } else {
+            this.props.dispatch(snackbarActions.OPEN_SNACKBAR({
+                message: 'Creating new tokens is not allowed',
+                hideDuration: 2000,
+                kind: SnackbarKind.WARNING
+            }));
         }
     }