-
Notifications
You must be signed in to change notification settings - Fork 111
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
more strictNullChecks #3729
more strictNullChecks #3729
Conversation
@@ -119,7 +119,7 @@ export function createSchemaForTable( | |||
) as ReturnType<typeof createConnectorServiceOLAPGetTable>; | |||
} | |||
|
|||
export function resourceIsLoading(resource: V1Resource) { | |||
export function resourceIsLoading(resource?: V1Resource) { |
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.
already checks for undefined input right below, the function just wasn't typed correctly
@ericpgreen2 , picked off strictNullChecks in |
web-common/src/features/sources/workspace/SourceWorkspaceHeader.svelte
Outdated
Show resolved
Hide resolved
overlay.set({ title: `Importing ${tableName}.yaml` }); | ||
await saveAndRefresh(tableName, $sourceStore.clientYAML); | ||
checkSourceImported(queryClient, sourceName, filePath); | ||
overlay.set(null); | ||
}; | ||
|
||
const onRefreshClick = async (tableName: string) => { | ||
// no-op if connector is undefined | ||
if (connector === undefined) return; |
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.
Similar to above. If connector
is undefined
, can we instead disable the Button so this code path is never hit?
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.
we can disable the button, but we can't take out this check because of the way the component is set up. In practice, I think this code path will never actually be hit anyway. This whole thing is ugly anyway (see eg the try/catch with a no-op directly below) and could use a refactor, but I'm gonna make the call that that's out of scope for this PR
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.
Left a variety of comments, but will approve and you can address as you see fit
part of #3373