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

Avoid resetting changes state when not showing stash #9921

Merged
merged 2 commits into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/src/lib/stores/app-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,13 @@ export class AppStore extends TypedBaseStore<IAppState> {
}

public _hideStashedChanges(repository: Repository) {
const { changesState } = this.repositoryStateCache.get(repository)

// makes this safe to call even when the stash ui is not visible
if (changesState.selection.kind !== ChangesSelectionKind.Stash) {
niik marked this conversation as resolved.
Show resolved Hide resolved
return
}

this.repositoryStateCache.updateChangesState(repository, state => {
const files = state.workingDirectory.files
const selectedFileIds = files
Expand Down