initializeProfileIfNeeded method

Future<bool> initializeProfileIfNeeded()

Initializes the user profile if it doesn't exist.

Implementation

Future<bool> initializeProfileIfNeeded() async {
  try {
    final profile = await getUserProfile();
    if (profile == null) {
      // Create a basic profile.

      return await createOrUpdateUserProfile();
    }

    return true;
  } catch (e) {
    debugPrint('❌ Failed to initialize profile: $e');
    return false;
  }
}