Change action name and logging

This commit is contained in:
Nir 2024-08-14 09:01:11 +03:00 committed by GitHub
parent bb791f7d13
commit a8f6e0a3b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -1,18 +1,18 @@
<script lang="ts">
import Button from '@gitbutler/ui/inputs/Button.svelte';
import { goto } from '$app/navigation';
async function defaultBeforeOnMouseDown() {
async function defaultPreMouseDown() {
Promise.resolve();
}
export let beforeOnMouseDown: () => Promise<void> = defaultBeforeOnMouseDown;
export let preMouseDown: () => Promise<void> = defaultPreMouseDown;
</script>
<Button
style="ghost"
outline
onmousedown={() => {
beforeOnMouseDown().then(
preMouseDown().then(
() => {
if (history.length > 0) {
history.back();
@ -21,7 +21,7 @@
}
},
(err) => {
console.log('The pre-back button action failed');
console.log('Failed to execute the pre-mouse-down action');
console.log(err);
}
);

View File

@ -258,7 +258,7 @@
</SetupFeature>
</div>
<div class="action-buttons">
<BackButton beforeOnMouseDown={deleteProject}>Cancel</BackButton>
<BackButton preMouseDown={deleteProject}>Cancel</BackButton>
<Button
style="pop"
kind="solid"