Menu Issues - Logged In, Logged Out, Secondary Menu

In my functions.php I have the following code to allow me to have two primary menus - logged out and logged in.

/* Begin - Shows different Menus for logged in and logged out */
function my_wp_nav_menu_args( $args = '' ) {
if( is_user_logged_in() ) {
$args['menu'] = 'logged-in';
} else {
$args['menu'] = 'logged-out';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

function wp_username_in_nav( $menu ){
global $current_user;
return $menu = str_replace('--sububsername--', $current_user->user_login, $menu );
}
add_filter( 'wp_nav_menu', 'wp_username_in_nav' );
/* End - Shows different Menus for logged in and logged out */

My theme allows me to also have a secondary menu but it doesn't work with the code above. The developer says:

you only want to apply it to the primary theme location, so you need to wrap your args in something like this:

if ( $args->theme_location == 'primary' ) {
if( is_user_logged_in() ) {
$args['menu'] = 'logged-in';
} else {
$args['menu'] = 'logged-out';
}
}

But I have tried all variations and just can't get it to work.

Can you tell me please what I should have between

/* Begin - Shows different Menus for logged in and logged out */
and
/* End - Shows different Menus for logged in and logged out */

that will allow me to have a primary menu for logged out members, which changes when they login, PLUS a secondary menu.

Many thanks!