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

Don't show unsaved changes warning modal after table creation #1935

Merged

Conversation

therealrinku
Copy link
Contributor

Fixes: #1925

Copy link
Collaborator

@rathboma rathboma left a comment

Choose a reason for hiding this comment

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

Hey! Thanks for submitting this code. I think this is a great addition, but I think we should make one change to the API you are introducing.

Instead of passing an action to the close function, I think it'd be good if instead it was an optional object. This way it's a general purpose feature that any tab can use.

Something like:

this.$root.$emit(AppEvent.closeTab, this.tabId, { ignoreUnsavedChanges: true })

Then the close signature is something like:

interface CloseTabOptions {
  ignoreUnsavedChanges?: boolean
}
async close(tab: OpenTab, options?: CloseTabOptions) {...}

@therealrinku
Copy link
Contributor Author

Hi @rathboma !
Thanks for the review. Yeah that make sense. I have made some changes for that.

I was also thinking about maybe adding the tabId property also to that options object
but for now I just added ignoreUnsavedChanges property only in there 😄

Copy link
Collaborator

@rathboma rathboma left a comment

Choose a reason for hiding this comment

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

Thanks so much!

@rathboma rathboma merged commit 65af9cb into beekeeper-studio:master Feb 13, 2024
4 checks passed
@therealrinku therealrinku deleted the fix/popup-after-creating-table branch February 14, 2024 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Creating a new table triggers the unsaved changes dialog
2 participants