Bläddra i källkod

fixed delete landmark loading

cdmoss 2 år sedan
förälder
incheckning
0ed9ac1f35
1 ändrade filer med 6 tillägg och 4 borttagningar
  1. 6 4
      src/components/Map/Panels/LandmarkDetailsPanel/LandmarkDetails.tsx

+ 6 - 4
src/components/Map/Panels/LandmarkDetailsPanel/LandmarkDetails.tsx

@@ -180,6 +180,8 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
             if (deleteLandmarkMutation.isSuccess) {
                 deleteLandmarkMutation.reset()
             }
+
+            console.log(deleteLandmarkMutation.status)
         }
         resetDeleteLMOnSuccess();
     }, [deleteLandmarkMutation.status]);
@@ -236,14 +238,14 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
      * Calls the {@linkcode deleteLandmark} mutation from the {@link useLandmarks} hook and closes the modal once finished.
      */
     const removeLandmark = async () => {
-        Alert.alert("Are you sure you want to delete landmark here?", undefined,
+        Alert.alert("Are you sure you want to delete this landmark?", undefined,
       [{ text: "Cancel", }
         ,
       {
         text: "Confirm", onPress: async () => {
             await deleteLandmarkMutation.mutateAsync(landmarkId);   
             toggleDetailsPanel(false);
-            Alert.alert("LANDMARK HAS BEEN DELETED")
+            Alert.alert("Landmark Deleted", "This landmark has been deleted.");
         }
       }])
     }
@@ -370,8 +372,8 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
                 </View>
                 :
                 (landmarkQuery.isSuccess || landmarkQuery.isIdle) && 
-                editLandmarkMutation.isIdle || editLandmarkMutation.isSuccess && 
-                deleteLandmarkMutation.isIdle || deleteLandmarkMutation.isSuccess ?
+                (editLandmarkMutation.isIdle || editLandmarkMutation.isSuccess) && 
+                (deleteLandmarkMutation.isIdle || deleteLandmarkMutation.isSuccess) ?
                 <>
                 <DetailsHeader
                     authNavigation={authNavigation}