Fix: Empty main location bug (partially addressed in commit a2a7ae5fc6
)
parent
780d3cbbc2
commit
63bedb0280
|
@ -201,9 +201,8 @@ class _UserDataPageState extends State<UserDataPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save locations
|
// Save locations
|
||||||
if (_mainLocation != _mainLocationFromDb) {
|
if (_mainLocation == null || _mainLocation != _mainLocationFromDb) {
|
||||||
if (_mainLocation != null) {
|
if (_mainLocation != null) {
|
||||||
// Update existing user document with new locations
|
|
||||||
await locationsRef
|
await locationsRef
|
||||||
.doc(Constants.dbDocMainLocation)
|
.doc(Constants.dbDocMainLocation)
|
||||||
.set(_mainLocation!.toMap());
|
.set(_mainLocation!.toMap());
|
||||||
|
@ -212,7 +211,6 @@ class _UserDataPageState extends State<UserDataPage> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_secondaryLocation != _secondaryLocationFromDb) {
|
if (_secondaryLocation != _secondaryLocationFromDb) {
|
||||||
if (_secondaryLocation != null) {
|
if (_secondaryLocation != null) {
|
||||||
await locationsRef
|
await locationsRef
|
||||||
|
|
Loading…
Reference in New Issue