display home country in map
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user