Repository navigation
Show a placeholder for lost repositories - #946
Conversation
Disturbingly, using a for .. of seems to break TS' awaiting.
(Bugs hide here)
|
Ready for review 🦌 |
| @@ -267,10 +267,17 @@ export class AppStore { | |||
| if (!repository) { return null } | |||
|
|
|||
| if (repository instanceof Repository) { | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @@ -499,15 +512,19 @@ export class AppStore { | |||
| if (repository instanceof Repository) { | |||
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.
| newSelectedRepository = null | ||
| } | ||
| const r = this.repositories.find(r => | ||
| selectedRepository.constructor === r.constructor && r.id === selectedRepository.id |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| if (!this.selectedRepository && this.repositories.length > 0) { | ||
| if (!newSelectedRepository && this.repositories.length > 0) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| public async postError(error: Error): Promise<void> { | ||
| let currentError: Error | null = error | ||
| for (const handler of this.errorHandlers.reverse()) { | ||
| for (let i = this.errorHandlers.length - 1; i >= 0; i--) { |
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.
| } | ||
|
|
||
| /** Clone the repository again to the path and update the existing repository state. */ | ||
| public async cloneAgain(url: string, path: string, user: User | null): Promise<void> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const { promise, repository } = this.appStore._clone(url, path, user) | ||
| await this.selectRepository(repository) | ||
| const success = await promise | ||
| if (!success) { return } |
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.
| const cloneURL = gitHubRepository.cloneURL | ||
| if (!cloneURL) { return } | ||
|
|
||
| // TODO: find suitable user for credentials |
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.
|
🌔 |
👍 Yeah, let's go with the normal button styles. We can also consider calling out "Locate" as the primary action. |
|
🐨 |
|
Design wise this looks great, I'll let @iAmWillShepherd finish the technical review |
|
I'll leave it to @shiftkey to merge conflicts. You can merge in afterwards if you like. |


This is dependent on desktop/dugite#66.Fixes #350
RepositoryDoesNotExistErrorCode).gitdir is gone (GitError. NotAGitRepository)