Instead of using get_current_user_id()
use
$current_view = get_queried_object();
The $current_view
will have the same properties as get_current_user()
if it is used in author.php. To get the User ID, just use
$current_view_id = $current_view->ID
Hope this help