mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-30 20:09:50 +03:00
fix: wire up prService template fns correctly
This commit is contained in:
parent
8194283275
commit
09b02feb78
@ -91,7 +91,7 @@
|
||||
const prTemplatePath = project.git_host.pullRequestTemplatePath;
|
||||
|
||||
if (prTemplatePath) {
|
||||
pullRequestTemplateBody = await $gitHost.getPrTemplateContent(prTemplatePath);
|
||||
pullRequestTemplateBody = await $prService?.getPrTemplateContent(prTemplatePath);
|
||||
}
|
||||
|
||||
if (pullRequestTemplateBody) {
|
||||
|
@ -107,7 +107,7 @@ export class GitHubPrService implements GitHostPrService {
|
||||
|
||||
const availableTemplates: string[] | undefined = await invoke(
|
||||
'available_pull_request_templates',
|
||||
{ path: targetPath }
|
||||
{ rootPath: targetPath }
|
||||
);
|
||||
|
||||
return availableTemplates;
|
||||
|
@ -2,6 +2,7 @@
|
||||
import { Project, ProjectService } from '$lib/backend/projects';
|
||||
import SectionCard from '$lib/components/SectionCard.svelte';
|
||||
import { getGitHost } from '$lib/gitHost/interface/gitHost';
|
||||
import { createGitHostPrServiceStore } from '$lib/gitHost/interface/gitHostPrService';
|
||||
import Select from '$lib/select/Select.svelte';
|
||||
import SelectItem from '$lib/select/SelectItem.svelte';
|
||||
import Section from '$lib/settings/Section.svelte';
|
||||
@ -12,6 +13,8 @@
|
||||
const projectService = getContext(ProjectService);
|
||||
const project = getContext(Project);
|
||||
const gitHost = getGitHost();
|
||||
const prService = createGitHostPrServiceStore(undefined);
|
||||
$effect(() => prService.set($gitHost?.prService()));
|
||||
|
||||
let useTemplate = $state(!!project.git_host?.pullRequestTemplatePath);
|
||||
let selectedTemplate = $state(project.git_host?.pullRequestTemplatePath ?? '');
|
||||
@ -19,7 +22,7 @@
|
||||
|
||||
$effect(() => {
|
||||
if (!project.path) return;
|
||||
$gitHost?.getAvailablePrTemplates(project.path).then((availableTemplates) => {
|
||||
$prService?.getAvailablePrTemplates(project.path).then((availableTemplates) => {
|
||||
if (availableTemplates) {
|
||||
allAvailableTemplates = availableTemplates.map((availableTemplate) => {
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user