Skip to content
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

Clean up webview factory #3277

Merged
merged 1 commit into from
Feb 16, 2023
Merged

Clean up webview factory #3277

merged 1 commit into from
Feb 16, 2023

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Feb 14, 2023

2/2 main <- #3235 <- this

Follow up from this comment. Simplifies/cleans up the webview factory.

@mattseddon mattseddon self-assigned this Feb 14, 2023
@mattseddon mattseddon changed the base branch from main to add-connect-to-studio February 14, 2023 05:17
const isValidDvcRoot = (dvcRoot?: string): dvcRoot is string => !!dvcRoot

const needsDvcRoot = (viewKey: ViewKey): boolean =>
![ViewKey.CONNECT, ViewKey.SETUP].includes(viewKey)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[F] I think this is ok because the factory already knows about the type of webviews it is creating.

await view.isReady()
return view
}

export const restoreWebview = <T extends WebviewData>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[F] This is a relic from a previous feature.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪦

@mattseddon mattseddon marked this pull request as ready for review February 14, 2023 05:39
Copy link
Contributor

@julieg18 julieg18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Base automatically changed from add-connect-to-studio to main February 16, 2023 21:47
@mattseddon mattseddon enabled auto-merge (squash) February 16, 2023 22:16
@codeclimate
Copy link

codeclimate bot commented Feb 16, 2023

Code Climate has analyzed commit 4104496 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.0%.

View more on Code Climate.

@mattseddon mattseddon merged commit 1636be9 into main Feb 16, 2023
@mattseddon mattseddon deleted the update-factory branch February 16, 2023 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants