mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-04 15:53:30 +03:00
Use reactive variables for page data
We need to use reactive variables for page data, otherwise they do not trigger recalculation on navigation.
This commit is contained in:
parent
7f633e59f5
commit
a364fc9341
@ -3,7 +3,9 @@
|
||||
import BaseBranch from './BaseBranch.svelte';
|
||||
|
||||
export let data: PageData;
|
||||
let { projectId, branchController, baseBranchService } = data;
|
||||
$: projectId = data.projectId;
|
||||
$: branchController = data.branchController;
|
||||
$: baseBranchService = data.baseBranchService;
|
||||
$: base$ = baseBranchService.base$;
|
||||
$: error$ = baseBranchService.error$;
|
||||
</script>
|
||||
|
@ -15,7 +15,6 @@
|
||||
import type { Update } from '../../updater';
|
||||
import DomainButton from './DomainButton.svelte';
|
||||
import IconBranch from '$lib/icons/IconBranch.svelte';
|
||||
import IconSettings from '$lib/icons/IconSettings.svelte';
|
||||
import type { PrService } from '$lib/github/pullrequest';
|
||||
import type { BaseBranchService, VirtualBranchService } from '$lib/vbranches/branchStoresCache';
|
||||
import type { RemoteBranchService } from '$lib/stores/remoteBranches';
|
||||
|
@ -5,8 +5,9 @@
|
||||
import { map } from 'rxjs';
|
||||
|
||||
export let data: PageData;
|
||||
let { branchController, prService } = data;
|
||||
|
||||
$: branchController = data.branchController;
|
||||
$: prService = data.prService;
|
||||
$: pr = prService.prs$?.pipe(
|
||||
map((prs) => prs.find((b) => b.number.toString() == $page.params.number))
|
||||
);
|
||||
|
@ -4,7 +4,9 @@
|
||||
import RemoteBranchPreview from './RemoteBranchPreview.svelte';
|
||||
|
||||
export let data: PageData;
|
||||
let { projectId, branchController, remoteBranchService } = data;
|
||||
$: projectId = data.projectId;
|
||||
$: branchController = data.branchController;
|
||||
$: remoteBranchService = data.remoteBranchService;
|
||||
$: branches$ = remoteBranchService.branches$;
|
||||
$: error$ = remoteBranchService.branchesError$;
|
||||
|
||||
|
@ -11,7 +11,12 @@
|
||||
import type { Key, Project } from '$lib/backend/projects';
|
||||
|
||||
export let data: PageData;
|
||||
const { projectService, cloud, user$, userService, project$ } = data;
|
||||
|
||||
$: projectService = data.projectService;
|
||||
$: project$ = data.project$;
|
||||
$: userService = data.userService;
|
||||
$: user$ = data.user$;
|
||||
$: cloud = data.cloud;
|
||||
|
||||
let deleteConfirmationModal: Modal;
|
||||
let isDeleting = false;
|
||||
|
@ -4,16 +4,15 @@
|
||||
import BranchLane from '../../components/BranchLane.svelte';
|
||||
|
||||
export let data: PageData;
|
||||
let {
|
||||
projectId,
|
||||
branchController,
|
||||
githubContext$,
|
||||
cloud,
|
||||
baseBranchService,
|
||||
vbranchService,
|
||||
user$
|
||||
} = data;
|
||||
|
||||
$: projectId = data.projectId;
|
||||
$: user$ = data.user$;
|
||||
$: githubContext$ = data.githubContext$;
|
||||
$: cloud = data.cloud;
|
||||
|
||||
$: branchController = data.branchController;
|
||||
$: vbranchService = data.vbranchService;
|
||||
$: baseBranchService = data.baseBranchService;
|
||||
$: baseBranch$ = baseBranchService.base$;
|
||||
|
||||
$: branches$ = vbranchService.branches$;
|
||||
|
Loading…
Reference in New Issue
Block a user