Minor UI tweaks
This commit is contained in:
@@ -68,7 +68,7 @@ import NavigationBar from 'src/components/scheduling/NavigationBar.vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { formatTime } from 'src/utils/schedule';
|
||||
import { useIntervalStore } from 'src/stores/interval';
|
||||
import { Interval } from 'src/stores/schedule.types';
|
||||
import { Interval, Reservation } from 'src/stores/schedule.types';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
@@ -78,6 +78,7 @@ const $q = useQuasar();
|
||||
const $router = useRouter();
|
||||
const { getAvailableIntervals } = useIntervalStore();
|
||||
const { selectedDate } = storeToRefs(useIntervalStore());
|
||||
const currentUser = useAuthStore().currentUser;
|
||||
|
||||
// interface DayScope {
|
||||
// timestamp: Timestamp;
|
||||
@@ -115,11 +116,19 @@ const getSortedIntervals = (timestamp: Timestamp, boat?: Boat): Interval[] => {
|
||||
// return s;
|
||||
// }
|
||||
|
||||
const createReservationFromInterval = (interval: Interval) => {
|
||||
$router.push({
|
||||
name: 'reserve-boat',
|
||||
query: { interval: interval.$id },
|
||||
});
|
||||
const createReservationFromInterval = (interval: Interval | Reservation) => {
|
||||
if (interval.user) {
|
||||
if (interval.user === currentUser?.$id) {
|
||||
$router.push({ name: 'edit-reservation', params: { id: interval.$id } });
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$router.push({
|
||||
name: 'reserve-boat',
|
||||
query: { interval: interval.$id },
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function handleSwipe({ ...event }) {
|
||||
|
||||
Reference in New Issue
Block a user