|
|
@ -1546,7 +1546,6 @@ export default class AccountViewView extends Vue { |
|
|
|
|
|
|
|
onMapReady(map: L.Map): void { |
|
|
|
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 |
|
|
|
const zoom = |
|
|
|
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 |
|
|
|
setTimeout(() => { |
|
|
|
this.isMapReady = true; |
|
|
|
logger.debug("Map ready set to true after mounted"); |
|
|
|
}, 500); |
|
|
|
} |
|
|
|
|
|
|
|
// Fallback method to handle map initialization failures |
|
|
|
private handleMapInitFailure(): void { |
|
|
|
logger.debug("Starting map initialization timeout (5 seconds)"); |
|
|
|
setTimeout(() => { |
|
|
|
if (!this.isMapReady) { |
|
|
|
logger.warn("Map failed to initialize, forcing ready state"); |
|
|
|
this.isMapReady = true; |
|
|
|
} else { |
|
|
|
logger.debug("Map initialized successfully, timeout not needed"); |
|
|
|
} |
|
|
|
}, 5000); // 5 second timeout |
|
|
|
} |
|
|
@ -1675,7 +1670,6 @@ export default class AccountViewView extends Vue { |
|
|
|
|
|
|
|
async deleteProfile(): Promise<void> { |
|
|
|
try { |
|
|
|
logger.debug("Attempting to delete profile for DID:", this.activeDid); |
|
|
|
const success = await this.profileService.deleteProfile(this.activeDid); |
|
|
|
if (success) { |
|
|
|
this.notify.success(ACCOUNT_VIEW_CONSTANTS.SUCCESS.PROFILE_DELETED); |
|
|
@ -1684,7 +1678,6 @@ export default class AccountViewView extends Vue { |
|
|
|
this.userProfileLongitude = 0; |
|
|
|
this.includeUserProfileLocation = false; |
|
|
|
this.isMapReady = false; // Reset map state |
|
|
|
logger.debug("Profile deleted successfully, UI state reset"); |
|
|
|
} else { |
|
|
|
this.notify.error(ACCOUNT_VIEW_CONSTANTS.ERRORS.PROFILE_DELETE_ERROR); |
|
|
|
} |
|
|
@ -1730,7 +1723,6 @@ export default class AccountViewView extends Vue { |
|
|
|
this.isMapReady = false; |
|
|
|
this.userProfileLatitude = 0; |
|
|
|
this.userProfileLongitude = 0; |
|
|
|
logger.debug("Location unchecked, map state reset"); |
|
|
|
} else { |
|
|
|
// Location checkbox was checked, start map initialization timeout |
|
|
|
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 |
|
|
|
setTimeout(() => { |
|
|
|
if (!this.isMapReady) { |
|
|
|
logger.debug("Setting map ready after timeout"); |
|
|
|
this.isMapReady = true; |
|
|
|
} |
|
|
|
}, 1000); // 1 second delay |
|
|
|