feat: shortcuts
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
import { ref } from 'vue';
|
||||
import Button from 'primevue/button';
|
||||
import InputText from 'primevue/inputtext';
|
||||
import { useConfirm } from 'primevue/useconfirm';
|
||||
import * as path from '@tauri-apps/api/path';
|
||||
import { invoke } from '../invoke';
|
||||
import { useGeneralStore, usePrfStore } from '../stores';
|
||||
@ -9,6 +10,8 @@ import { ProfileMeta } from '../types';
|
||||
|
||||
const general = useGeneralStore();
|
||||
const prf = usePrfStore();
|
||||
const confirmDialog = useConfirm();
|
||||
|
||||
const isEditing = ref(false);
|
||||
|
||||
const props = defineProps({
|
||||
@ -54,6 +57,14 @@ const deleteProfile = async () => {
|
||||
await prf.reloadList();
|
||||
await prf.reload();
|
||||
};
|
||||
|
||||
const promptDeleteProfile = async () => {
|
||||
confirmDialog.require({
|
||||
message: `Are you sure you want to delete ${props.p?.game}-${props.p?.name}?`,
|
||||
header: 'Delete profile',
|
||||
accept: deleteProfile,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -90,7 +101,7 @@ const deleteProfile = async () => {
|
||||
size="small"
|
||||
class="self-center ml-2"
|
||||
style="width: 2rem; height: 2rem"
|
||||
@click="deleteProfile"
|
||||
@click="promptDeleteProfile"
|
||||
/>
|
||||
<Button
|
||||
rounded
|
||||
|
Reference in New Issue
Block a user