Skip to content

Commit

Permalink
fix: group action modal redirect
Browse files Browse the repository at this point in the history
Signed-off-by: Svetoslav Borislavov <[email protected]>
  • Loading branch information
SvetBorislavov committed Jan 22, 2025
1 parent c80e463 commit 6db8e13
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions front-end/src/renderer/components/GroupActionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { ref } from 'vue';
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router';
import useTransactionGroupStore from '@renderer/stores/storeTransactionGroup';
import { redirectToPrevious } from '@renderer/utils';
import AppButton from '@renderer/components/ui/AppButton.vue';
import AppModal from '@renderer/components/ui/AppModal.vue';
Expand All @@ -15,9 +11,6 @@ const props = defineProps<{
skip?: boolean;
}>();
/* Stores */
const transactionGroup = useTransactionGroupStore();
/* Composables */
const router = useRouter();
const route = useRoute();
Expand All @@ -37,11 +30,13 @@ function handleEditItem() {
emit('editItem');
}
function handleDiscard() {
if (router.previousPath !== '/create-transaction-group') {
transactionGroup.clearGroup();
async function handleDiscard() {
const previousPath = router.previousPath;
if (previousPath !== '/create-transaction-group') {
await router.push('/create-transaction-group');
} else {
}
redirectToPrevious(router, '/transactions');
await router.push(previousPath || '/transactions');
}
function handleGroupAction() {
Expand Down

0 comments on commit 6db8e13

Please sign in to comment.