mirror of
https://github.com/desktop/desktop
synced 2024-10-30 17:25:09 +00:00
Set cherry picking progress state from snapshot
This commit is contained in:
parent
da2c827dda
commit
d2ee87bfb6
2 changed files with 23 additions and 0 deletions
|
@ -279,6 +279,7 @@ import {
|
|||
cherryPick,
|
||||
CherryPickResult,
|
||||
continueCherryPick,
|
||||
getCherryPickSnapshot,
|
||||
} from '../git/cherry-pick'
|
||||
|
||||
const LastSelectedRepositoryIDKey = 'last-selected-repository-id'
|
||||
|
@ -5896,6 +5897,20 @@ export class AppStore extends TypedBaseStore<IAppState> {
|
|||
|
||||
return result || CherryPickResult.Error
|
||||
}
|
||||
|
||||
/** This shouldn't be called directly. See `Dispatcher`. */
|
||||
public async _setCherryPickProgressFromState(repository: Repository) {
|
||||
const snapshot = await getCherryPickSnapshot(repository)
|
||||
if (snapshot === null) {
|
||||
return
|
||||
}
|
||||
|
||||
const { progress } = snapshot
|
||||
|
||||
this.repositoryStateCache.updateCherryPickState(repository, () => ({
|
||||
progress,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2703,4 +2703,12 @@ export class Dispatcher {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the cherry pick progress in application state by querying the Git
|
||||
* repository state.
|
||||
*/
|
||||
public setCherryPickProgressFromState(repository: Repository) {
|
||||
return this.appStore._setCherryPickProgressFromState(repository)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue