display home country in map
This commit is contained in:
@@ -27,17 +27,18 @@ export async function signOut() {
|
||||
needsCountry = false;
|
||||
}
|
||||
|
||||
export async function setHomeCountry(country) {
|
||||
export async function setHomeCountry(name, code) {
|
||||
if (!user) return;
|
||||
await setDoc(doc(db, 'users', user.uid), {
|
||||
displayName: user.displayName,
|
||||
photoURL: user.photoURL,
|
||||
email: user.email,
|
||||
homeCountry: country,
|
||||
visitedCountries: [],
|
||||
homeCountry: name,
|
||||
homeCountryCode: code,
|
||||
visitedCountries: [code],
|
||||
createdAt: serverTimestamp(),
|
||||
});
|
||||
userProfile = { ...userProfile, homeCountry: country, visitedCountries: [] };
|
||||
userProfile = { ...userProfile, homeCountry: name, homeCountryCode: code, visitedCountries: [code] };
|
||||
needsCountry = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user