{% if LET_ENABLE_AUTO_GENERATED_USERNAME %}
// tutor-contrib-let patch: show user full name in the user menu instead of the autogenerated username
const { getAuthenticatedUser } = await import('@edx/frontend-platform/auth');

function modifyDesktopUserMenuToggle(widget) {
  const authenticatedUser = getAuthenticatedUser();
  const label = authenticatedUser?.name || authenticatedUser?.username || '';

  widget.content = {
    ...(widget.content || {}),
    label,
  };

  return widget;
}
// end of tutor-contrib-let patch
{% endif %}
