From 63bedb02804ff71d2ad067a477fdebd7bcc5d44b Mon Sep 17 00:00:00 2001 From: Rafael <1024481@stud.hs-mannheim.de> Date: Tue, 18 Jun 2024 02:37:56 +0200 Subject: [PATCH] Fix: Empty main location bug (partially addressed in commit a2a7ae5fc6) --- lib/pages/user_data_page.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/pages/user_data_page.dart b/lib/pages/user_data_page.dart index 122fff7..db0e468 100644 --- a/lib/pages/user_data_page.dart +++ b/lib/pages/user_data_page.dart @@ -201,9 +201,8 @@ class _UserDataPageState extends State { } // Save locations - if (_mainLocation != _mainLocationFromDb) { + if (_mainLocation == null || _mainLocation != _mainLocationFromDb) { if (_mainLocation != null) { - // Update existing user document with new locations await locationsRef .doc(Constants.dbDocMainLocation) .set(_mainLocation!.toMap()); @@ -212,7 +211,6 @@ class _UserDataPageState extends State { return false; } } - if (_secondaryLocation != _secondaryLocationFromDb) { if (_secondaryLocation != null) { await locationsRef