mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-22 22:39:36 +02:00
Enhance Adventure model and serializers with visited status logic and toast notifications for marking visits
This commit is contained in:
parent
84cd136401
commit
a1062e72cf
4 changed files with 45 additions and 12 deletions
|
@ -55,7 +55,7 @@
|
|||
}
|
||||
|
||||
$: if (triggerMarkVisted && willBeMarkedVisited) {
|
||||
markVisited();
|
||||
displaySuccessToast(); // since the server will trigger the geocode automatically, we just need to show the toast and let the server handle the rest. It's kinda a placebo effect...
|
||||
triggerMarkVisted = false;
|
||||
}
|
||||
|
||||
|
@ -102,6 +102,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
function displaySuccessToast() {
|
||||
if (reverseGeocodePlace) {
|
||||
if (reverseGeocodePlace.region) {
|
||||
addToast('success', `Visit to ${reverseGeocodePlace.region} marked`);
|
||||
}
|
||||
if (reverseGeocodePlace.city) {
|
||||
addToast('success', `Visit to ${reverseGeocodePlace.city} marked`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function markVisited() {
|
||||
console.log(reverseGeocodePlace);
|
||||
if (reverseGeocodePlace) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue