-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quick misc fixes #1501
Quick misc fixes #1501
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any issues here, approved
setCreatorState({...creatorState, invalid: false}) | ||
setInstance({ ...instance, qset: data }) | ||
} | ||
if ( (data != null ? data.title : undefined) === 'Permission Denied' || (data && data.title === 'error')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check won't catch data == null
, but the API should never send a null object for this request. If an instance qset isn't found it sends a dummy one instead, so this should be sufficient.
@@ -215,7 +215,7 @@ const MyWidgetsPage = () => { | |||
widgetName: inst.widget.name, | |||
dir: inst.widget.dir, | |||
successFunc: (data) => { | |||
if (!data || (data.type == 'error')) | |||
if (data && (data.type == 'error')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lack of a null check here is probably fine since this is coming from the useDeleteWidget
mutation which handles errors.
…ile pic corners because it looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-upping approval.
data
before accessing properties ondata
(Ifdata
is null, that is usually a sign something went wrong on the server; this is just a front-end band-aid)