profile_include_location #170

Open
anomalist wants to merge 3 commits from profile_include_location into master
  1. 2
      src/components/LocationSearchSection.vue
  2. 1
      src/services/ProfileService.ts
  3. 9
      src/views/AccountViewView.vue

2
src/components/LocationSearchSection.vue

@ -26,7 +26,7 @@
:weight="2" :weight="2"
color="#3b82f6" color="#3b82f6"
fill-color="#3b82f6" fill-color="#3b82f6"
fill-opacity="0.2" :fill-opacity="0.2"
/> />
</l-map> </l-map>
</div> </div>

1
src/services/ProfileService.ts

@ -152,7 +152,6 @@ export class ProfileService {
// Handle specific HTTP status codes // Handle specific HTTP status codes
if (response.status === 204) { if (response.status === 204) {
logger.debug("Profile deleted successfully (204 No Content)");
return true; // 204 is success for DELETE operations return true; // 204 is success for DELETE operations
} else if (response.status === 404) { } else if (response.status === 404) {
logger.warn("Profile not found - may already be deleted"); logger.warn("Profile not found - may already be deleted");

9
src/views/AccountViewView.vue

@ -1546,7 +1546,6 @@ export default class AccountViewView extends Vue {
onMapReady(map: L.Map): void { onMapReady(map: L.Map): void {
try { try {
logger.debug("Map ready event fired, map object:", map);
// doing this here instead of on the l-map element avoids a recentering after a drag then zoom at startup // doing this here instead of on the l-map element avoids a recentering after a drag then zoom at startup
const zoom = const zoom =
this.userProfileLatitude && this.userProfileLongitude ? 12 : 2; this.userProfileLatitude && this.userProfileLongitude ? 12 : 2;
@ -1575,19 +1574,15 @@ export default class AccountViewView extends Vue {
// Try to set map ready after component is mounted // Try to set map ready after component is mounted
setTimeout(() => { setTimeout(() => {
this.isMapReady = true; this.isMapReady = true;
logger.debug("Map ready set to true after mounted");
}, 500); }, 500);
} }
// Fallback method to handle map initialization failures // Fallback method to handle map initialization failures
private handleMapInitFailure(): void { private handleMapInitFailure(): void {
logger.debug("Starting map initialization timeout (5 seconds)");
setTimeout(() => { setTimeout(() => {
if (!this.isMapReady) { if (!this.isMapReady) {
logger.warn("Map failed to initialize, forcing ready state"); logger.warn("Map failed to initialize, forcing ready state");
this.isMapReady = true; this.isMapReady = true;
} else {
logger.debug("Map initialized successfully, timeout not needed");
} }
}, 5000); // 5 second timeout }, 5000); // 5 second timeout
} }
@ -1675,7 +1670,6 @@ export default class AccountViewView extends Vue {
async deleteProfile(): Promise<void> { async deleteProfile(): Promise<void> {
try { try {
logger.debug("Attempting to delete profile for DID:", this.activeDid);
const success = await this.profileService.deleteProfile(this.activeDid); const success = await this.profileService.deleteProfile(this.activeDid);
if (success) { if (success) {
this.notify.success(ACCOUNT_VIEW_CONSTANTS.SUCCESS.PROFILE_DELETED); this.notify.success(ACCOUNT_VIEW_CONSTANTS.SUCCESS.PROFILE_DELETED);
@ -1684,7 +1678,6 @@ export default class AccountViewView extends Vue {
this.userProfileLongitude = 0; this.userProfileLongitude = 0;
this.includeUserProfileLocation = false; this.includeUserProfileLocation = false;
this.isMapReady = false; // Reset map state this.isMapReady = false; // Reset map state
logger.debug("Profile deleted successfully, UI state reset");
} else { } else {
this.notify.error(ACCOUNT_VIEW_CONSTANTS.ERRORS.PROFILE_DELETE_ERROR); this.notify.error(ACCOUNT_VIEW_CONSTANTS.ERRORS.PROFILE_DELETE_ERROR);
} }
@ -1730,7 +1723,6 @@ export default class AccountViewView extends Vue {
this.isMapReady = false; this.isMapReady = false;
this.userProfileLatitude = 0; this.userProfileLatitude = 0;
this.userProfileLongitude = 0; this.userProfileLongitude = 0;
logger.debug("Location unchecked, map state reset");
} else { } else {
// Location checkbox was checked, start map initialization timeout // Location checkbox was checked, start map initialization timeout
this.isMapReady = false; this.isMapReady = false;
@ -1739,7 +1731,6 @@ export default class AccountViewView extends Vue {
// Try to set map ready after a short delay to allow Vue to render // Try to set map ready after a short delay to allow Vue to render
setTimeout(() => { setTimeout(() => {
if (!this.isMapReady) { if (!this.isMapReady) {
logger.debug("Setting map ready after timeout");
this.isMapReady = true; this.isMapReady = true;
} }
}, 1000); // 1 second delay }, 1000); // 1 second delay

Loading…
Cancel
Save