diff --git a/index.html b/index.html index 43fea63..a54d554 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Vite + Vue + DOXFOOD
diff --git a/public/icon/layers-2x.png b/public/icon/layers-2x.png new file mode 100644 index 0000000..200c333 Binary files /dev/null and b/public/icon/layers-2x.png differ diff --git a/public/icon/layers.png b/public/icon/layers.png new file mode 100644 index 0000000..1a72e57 Binary files /dev/null and b/public/icon/layers.png differ diff --git a/public/icon/marker-icon-2x.png b/public/icon/marker-icon-2x.png new file mode 100644 index 0000000..88f9e50 Binary files /dev/null and b/public/icon/marker-icon-2x.png differ diff --git a/public/icon/marker-icon.png b/public/icon/marker-icon.png new file mode 100644 index 0000000..950edf2 Binary files /dev/null and b/public/icon/marker-icon.png differ diff --git a/public/icon/marker-shadow.png b/public/icon/marker-shadow.png new file mode 100644 index 0000000..9fd2979 Binary files /dev/null and b/public/icon/marker-shadow.png differ diff --git a/src/components/RatingField.vue b/src/components/RatingField.vue index 9ff7790..de8f0c7 100644 --- a/src/components/RatingField.vue +++ b/src/components/RatingField.vue @@ -27,7 +27,6 @@ const text = computed(() => { if (model.value === undefined || model.value === null) { return "0"; } - console.log(model.value); return `${round(model.value, 1)}`; }); diff --git a/src/components/RestaurantsMap.vue b/src/components/RestaurantsMap.vue index d23ae57..95d203b 100644 --- a/src/components/RestaurantsMap.vue +++ b/src/components/RestaurantsMap.vue @@ -7,6 +7,8 @@ import LatLng from "../models/map"; import { storeToRefs } from "pinia"; import { useRestaurantsStore } from "../stores/restaurants"; +L.Icon.Default.imagePath = "icon/"; + const map = ref(null); const { restaurants } = storeToRefs(useRestaurantsStore()); @@ -50,17 +52,14 @@ onMounted(() => { watch( () => props.highlighted, (newval, oldval) => { - console.log(markers.value); if (oldval != null) { var old = markers.value.get(oldval); - console.log("old", old, oldval); if (old.isPopupOpen()) { old.closePopup(); } } if (newval != null) { var marker = markers.value.get(newval); - console.log("new", marker, newval); if (!marker.isPopupOpen()) { marker.openPopup(); } diff --git a/src/components/RestaurantsTable.vue b/src/components/RestaurantsTable.vue index d548e1c..662a02f 100644 --- a/src/components/RestaurantsTable.vue +++ b/src/components/RestaurantsTable.vue @@ -41,7 +41,6 @@ const hovered = ref(); function onMouseOver(e) { const row = e.target?._DT_CellIndex?.row; - console.log("row", row); if (row !== undefined && props.data !== undefined) { if (hovered.value != props.data[row]) { @@ -51,7 +50,6 @@ function onMouseOver(e) { } else { if (hovered.value !== null) { emit("restaurantHovered", null); - console.log("hovered"); } hovered.value = null; } diff --git a/src/components/ReviewsList.vue b/src/components/ReviewsList.vue index ca817cc..2b39490 100644 --- a/src/components/ReviewsList.vue +++ b/src/components/ReviewsList.vue @@ -15,13 +15,11 @@ async function load(restaurantId: string) { expand: "user", sort: "-created", }); - console.log(reviews.value); } watch( () => props.restaurant, async (newval, oldval) => { - console.log("fetch"); if (props.restaurant === undefined) { reviews.value = []; } else { diff --git a/src/stores/restaurants.ts b/src/stores/restaurants.ts index 78cd941..39bf254 100644 --- a/src/stores/restaurants.ts +++ b/src/stores/restaurants.ts @@ -1,9 +1,10 @@ import { defineStore } from "pinia"; -import { pb } from "../pocketbase"; +import { currentUser, pb } from "../pocketbase"; import { average } from "../utils/math"; import Restaurant from "../models/restaurant"; import _ from "lodash"; +import { watch } from "vue"; export const useRestaurantsStore = defineStore("restaurants", { state: () => ({ @@ -44,11 +45,15 @@ export const useRestaurantsStore = defineStore("restaurants", { await this.load(); pb.collection("restaurants").subscribe("*", async (e) => { - this.load(); + await this.load(); }); pb.collection("reviews").subscribe("*", async (e) => { - this.load(); + await this.load(); + }); + + watch(currentUser, async (newUser, oldUser) => { + await this.load(); }); }, }, diff --git a/src/views/ListView.vue b/src/views/ListView.vue index b6e670a..d03544f 100644 --- a/src/views/ListView.vue +++ b/src/views/ListView.vue @@ -1,15 +1,11 @@ diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index 62d02c4..dfcff0b 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -15,17 +15,13 @@ async function login() { return; } - await pb.collection("users").authWithPassword(username.value, password.value); + await pb.collection("users").authWithPassword(username.value!, password.value!); }