Moves Conflict state into Changes state#5901
Merged
shiftkey merged 7 commits intodid-you-merge-itfrom Oct 16, 2018
Merged
Conversation
shiftkey
suggested changes
Oct 16, 2018
Member
shiftkey
left a comment
There was a problem hiding this comment.
Looks good. I've called out some places where you can avoid merging objects when updating conflictsState to simplify the code, and one question about some refactoring.
app/src/lib/stores/app-store.ts
Outdated
| @@ -1502,7 +1501,7 @@ export class AppStore extends TypedBaseStore<IAppState> { | |||
| if (previousBranch.name !== currentBranchName) { | |||
| this.statsStore.recordMergeAbortedAfterConflicts() | |||
| this.repositoryStateCache.update(repository, () => ({ | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
app/src/lib/stores/app-store.ts
Outdated
| this.repositoryStateCache.update(repository, () => ({ | ||
| conflictState: { | ||
| branch: tip.branch, | ||
| changesState: { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
app/src/lib/stores/app-store.ts
Outdated
|
|
||
| this.repositoryStateCache.update(repository, () => ({ | ||
| conflictState: null, | ||
| changesState: { ...repoState.changesState, conflictState: null }, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
app/src/lib/stores/app-store.ts
Outdated
| const conflictsExist = repoState.conflictState !== null | ||
| const { conflictState } = repoState.changesState | ||
|
|
||
| if (conflictsExist) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
shiftkey
approved these changes
Oct 16, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses #5810 (comment)