How to switch menu location in this header.php?

As far as I understand this would be one of the menus:

$et_secondary_nav = $et_secondary_nav_items->secondary_nav;

And this is the other:

$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'top-menu', 'echo' => false ) );

This is where the first menu gets displayed:

if ( '' !== $et_secondary_nav ) {
    echo $et_secondary_nav;
}

And the second one:

$primaryNav = '';

$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'top-menu', 'echo' => false ) );
if ( '' == $primaryNav ) :
?>
<ul id="top-menu" class="<?php echo esc_attr( $menuClass ); ?>">
    <?php if ( 'on' == et_get_option( 'divi_home_link' ) ) { ?>
        <li <?php if ( is_home() ) echo( 'class="current_page_item"' ); ?>><a href="https://wordpress.stackexchange.com/questions/302969/<?php echo esc_url( home_url("https://wordpress.stackexchange.com/" ) ); ?>"><?php esc_html_e( 'Home', 'Divi' ); ?></a></li>
    <?php }; ?>

    <?php show_page_menu( $menuClass, false, false ); ?>
    <?php show_categories_menu( $menuClass, false ); ?>
</ul>
<?php
else :
    echo( $primaryNav );
endif;

I think changing the two code snippets where it gets displayed should do the trick, but that doesn’t mean that you won’t need additional styling after changing these.