Member Junction
    Preparing search index...

    Service for managing user avatar operations across the application.

    NOTE: This service does NOT depend on any Explorer-specific packages to remain usable across different Angular applications. All auth provider logic should be handled by the calling code.

    Index

    Constructors

    Methods

    • Converts a File to a Base64 data URI string Used for file uploads in settings UI

      Parameters

      • file: File

      Returns Promise<string>

    • Gets the display URL for an avatar based on user settings Priority: UserImageURL > UserImageIconClass > default

      Parameters

      • user: MJUserEntity

        The MJUserEntity

      • defaultUrl: string = 'assets/user.png'

        Optional default URL if no avatar is set

      Returns string | null

      The URL to display, or null if using an icon

    • Gets the icon class for an avatar if using icon mode

      Parameters

      Returns string | null

    • Validates if a string is a valid Base64 data URI

      Parameters

      • dataUri: string

      Returns boolean

    • Validates if a string is a valid URL

      Parameters

      • url: string

      Returns boolean

    • Syncs user avatar from an image URL (typically from auth provider profile). Downloads the image, converts to Base64, and saves to the user entity.

      Parameters

      • user: MJUserEntity

        The MJUserEntity to update with avatar data

      • imageUrl: string

        URL to the image (can be from Microsoft Graph, Google, etc.)

      • OptionalauthHeaders: Record<string, string>

        Optional headers for authenticated requests (e.g., { 'Authorization': 'Bearer token' })

      Returns Promise<boolean>

      Promise - true if avatar was synced and saved, false otherwise