display home country in map

This commit is contained in:
2026-06-12 19:19:20 +09:00
parent 6701398da7
commit f198c05063
6 changed files with 140 additions and 34 deletions

View File

@@ -3,6 +3,7 @@ import { doc, onSnapshot, updateDoc, arrayUnion, arrayRemove } from 'firebase/fi
let selected = $state(new Set());
let totalCountries = $state(0);
let homeCountryCode = $state(null);
let _uid = null;
let _unsubscribe = null;
@@ -14,6 +15,7 @@ export function initSelectionListener(uid) {
if (snap.exists()) {
const codes = snap.data().visitedCountries || [];
selected = new Set(codes);
homeCountryCode = snap.data().homeCountryCode || null;
}
});
}
@@ -54,3 +56,7 @@ export function setTotalCount(n) {
export function getTotalCount() {
return totalCountries;
}
export function getHomeCountryCode() {
return homeCountryCode;
}