Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvonen committed Jan 24, 2024
1 parent bfd2df2 commit d57e3f5
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/export.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ it('downloads calendar file', () => {
cy.get('.dp__calendar_item:not([aria-disabled])').first().click();
cy.getByTestId('navbar-export-link').click();
cy.getByTestId('export-download-button').click();
cy.readFile(path.normalize(path.join(Cypress.config('downloadsFolder'), 'TrainingSchedule.ics'))).should('exist');
cy.readFile(path.join(Cypress.config('downloadsFolder'), 'TrainingSchedule.ics')).should('exist');
});
3 changes: 1 addition & 2 deletions src/components/ConfirmDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import {storeToRefs} from 'pinia';
import {useAppStateStore} from '@/stores/appState';
import BaseDialog from '@/components/BaseDialog.vue';
const appStateStore = useAppStateStore();
const {confirmDialogOpen, confirmText, confirmAction} = storeToRefs(appStateStore);
const {confirmDialogOpen, confirmText, confirmAction} = storeToRefs(useAppStateStore());
</script>
<template>
<BaseDialog
Expand Down
3 changes: 1 addition & 2 deletions src/components/EditTrainingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const scheduleStore = useScheduleStore();
const {settings} = storeToRefs(scheduleStore);
const {addOrEditTraining} = scheduleStore;
const appStateStore = useAppStateStore();
const {trainingDialogOpen, trainingData} = storeToRefs(appStateStore);
const {trainingDialogOpen, trainingData} = storeToRefs(useAppStateStore());
const {t} = useI18n();
Expand Down
3 changes: 1 addition & 2 deletions src/components/SimpleTrainingCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ defineProps<{
training: Training;
}>();
const scheduleStore = useScheduleStore();
const {settings} = storeToRefs(scheduleStore);
const {settings} = storeToRefs(useScheduleStore());
</script>
<template>
<div class="simple-training-card mt-4">
Expand Down
3 changes: 1 addition & 2 deletions src/components/TrainingCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ defineProps<{
training: Training;
}>();
const scheduleStore = useScheduleStore();
const {settings} = storeToRefs(scheduleStore);
const {settings} = storeToRefs(useScheduleStore());
</script>
<template>
<v-card class="training-card mx-2 mt-4 mb-2">
Expand Down
6 changes: 2 additions & 4 deletions src/components/TrainingCardActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ defineProps<{
training: Training;
}>();
const scheduleStore = useScheduleStore();
const {deleteTraining} = scheduleStore;
const {deleteTraining} = useScheduleStore();
const appStateStore = useAppStateStore();
const {openEditTrainingDialog} = appStateStore;
const {openEditTrainingDialog} = useAppStateStore();
</script>
<template>
<v-card-actions class="flex-column align-stretch">
Expand Down
3 changes: 1 addition & 2 deletions src/components/WeekCalendarActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ defineProps<{
dayIndex: number;
}>();
const scheduleStore = useScheduleStore();
const {deleteWeek, copyWeek} = scheduleStore;
const {deleteWeek, copyWeek} = useScheduleStore();
const {openNewTrainingDialog} = useAppStateStore();
Expand Down
3 changes: 1 addition & 2 deletions src/views/ExportView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import WeekSupplement from '@/components/WeekSupplement.vue';
import PrintViewTable from '@/components/PrintViewTable.vue';
import BaseView from '@/components/BaseView.vue';
const scheduleStore = useScheduleStore();
const {settings, weeks} = storeToRefs(scheduleStore);
const {settings, weeks} = storeToRefs(useScheduleStore());
const reset = useReset();
Expand Down
3 changes: 1 addition & 2 deletions src/views/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {DATE_FORMATS} from '@/constants';
import {decimalRegex} from '@/utils';
import BaseView from '@/components/BaseView.vue';
const scheduleStore = useScheduleStore();
const {settings} = storeToRefs(scheduleStore);
const {settings} = storeToRefs(useScheduleStore());
const {t} = useI18n();
Expand Down

0 comments on commit d57e3f5

Please sign in to comment.