Update base branch conditionally in button click event

The button click event was modified to show a modal only if a certain condition is not met; otherwise, it will immediately update the base branch. The condition depends on the state of the `mergeUpstreamWarningDismissed` variable. 

Changes:
- Replaced the direct function call `updateTargetModal.show` upon button click with a conditional function.
- Now, on button click, if `mergeUpstreamWarningDismissed` is true, the base branch gets updated using `branchController.updateBaseBranch()`.
- If `mergeUpstreamWarningDismissed` is false, the previous functionality remains, i.e., `updateTargetModal.show` gets called
This commit is contained in:
Kiril Videlov 2023-08-29 10:38:04 +02:00 committed by Kiril Videlov
parent ec2131baf4
commit 1e35aab885

View File

@ -43,7 +43,13 @@
width="full-width"
height="small"
color="purple"
on:click={updateTargetModal.show}
on:click={() => {
if ($mergeUpstreamWarningDismissed) {
branchController.updateBaseBranch();
} else {
updateTargetModal.show;
}
}}
>
Merge into common base
</Button>