mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-01 04:14:45 +03:00
Fix idleness after PR creation
- also drop unused dependencies
This commit is contained in:
parent
0254190eaf
commit
d798ef84c0
@ -47,7 +47,7 @@
|
||||
class:grow
|
||||
class:not-clickable={notClickable}
|
||||
bind:this={element}
|
||||
{disabled}
|
||||
disabled={disabled || loading}
|
||||
on:click
|
||||
{id}
|
||||
tabindex={notClickable ? -1 : tabindex}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import * as toasts from '$lib/utils/toasts';
|
||||
import lscache from 'lscache';
|
||||
import type { BaseBranchService, VirtualBranchService } from '$lib/vbranches/branchStoresCache';
|
||||
import type { BranchController } from '$lib/vbranches/branchController';
|
||||
import type { BaseBranchService } from '$lib/vbranches/branchStoresCache';
|
||||
import type { UserService } from '$lib/stores/user';
|
||||
import type { Octokit } from '@octokit/rest';
|
||||
import { newClient } from '$lib/github/client';
|
||||
@ -51,12 +50,7 @@ export class GitHubService {
|
||||
|
||||
private enabled = false;
|
||||
|
||||
constructor(
|
||||
private branchController: BranchController,
|
||||
private vbranchService: VirtualBranchService,
|
||||
userService: UserService,
|
||||
baseBranchService: BaseBranchService
|
||||
) {
|
||||
constructor(userService: UserService, baseBranchService: BaseBranchService) {
|
||||
// A few things will cause the baseBranch to update, so we filter for distinct
|
||||
// changes to the remoteUrl.
|
||||
const distinctUrl$ = baseBranchService.base$.pipe(distinct((ctx) => ctx?.remoteUrl));
|
||||
@ -197,9 +191,9 @@ export class GitHubService {
|
||||
} else {
|
||||
console.log('Unable to create PR despite retrying', err);
|
||||
}
|
||||
this.setIdle(branchId);
|
||||
return throwError(() => err);
|
||||
})
|
||||
}),
|
||||
tap(() => this.setIdle(branchId))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -33,12 +33,7 @@ export const load: LayoutLoad = async ({ params, parent }) => {
|
||||
baseBranchService
|
||||
);
|
||||
|
||||
const githubService = new GitHubService(
|
||||
branchController,
|
||||
vbranchService,
|
||||
userService,
|
||||
baseBranchService
|
||||
);
|
||||
const githubService = new GitHubService(userService, baseBranchService);
|
||||
const branchService = new BranchService(vbranchService, remoteBranchService, githubService);
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user