@@ -14,7 +14,6 @@ let userMarker = null
1414// Loading states
1515const isLoadingMap = ref (true )
1616const isLoadingLocation = ref (false )
17- const isLoadingDivision = ref (false )
1817
1918// Initialize Supabase client
2019const supabase = createClient (
@@ -45,7 +44,7 @@ const props = defineProps({
4544 }
4645})
4746
48- const emit = defineEmits ([' update:searchResults' ])
47+ const emit = defineEmits ([' update:searchResults' , ' update:loading ' ])
4948
5049// Create a custom marker element
5150function createMarkerElement () {
@@ -141,7 +140,7 @@ async function getUserLocation() {
141140// Function to select and load division data
142141async function selectDivision (division , location = null ) {
143142 console .log (' Selecting division:' , division);
144- isLoadingDivision . value = true ;
143+ emit ( ' update:loading ' , true ) ;
145144
146145 try {
147146 const { data , error } = await supabase
@@ -180,7 +179,7 @@ async function selectDivision(division, location = null) {
180179 } catch (err) {
181180 console .error (' Search error:' , err);
182181 } finally {
183- isLoadingDivision . value = false ;
182+ emit ( ' update:loading ' , false ) ;
184183 }
185184}
186185
@@ -339,11 +338,6 @@ onUnmounted(() => {
339338 <div class =" loading-spinner" ></div >
340339 <div class =" loading-text" >Getting your location...</div >
341340 </div >
342-
343- <div v-if =" isLoadingDivision" class =" loading-overlay" >
344- <div class =" loading-spinner" ></div >
345- <div class =" loading-text" >Loading division data...</div >
346- </div >
347341 </div >
348342</template >
349343
0 commit comments