export function navigateToExternalUrl(url, optionalQuery = {}) {
    // possibly show some loading screen in the future here.
    var externalUrl = new URL(url);

    for (const queryKey in optionalQuery) {
        externalUrl.searchParams.append(queryKey, optionalQuery[queryKey]);
    }

    window.location.assign(externalUrl);
}
