Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/src/js/frontend/dashboard/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const header = () => {
onSuccess: (res: AjaxResponse) => {
window.TutorCore.toast.success(res?.message);
setTimeout(() => {
window.location.reload();
window.location.href = window._tutorobject.tutor_frontend_dashboard_url;
}, 1000);
},
onError: (error: Error) => {
Expand Down
7 changes: 3 additions & 4 deletions classes/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@

namespace TUTOR;

defined( 'ABSPATH' ) || exit;

use Tutor\Helpers\HttpHelper;
use Tutor\Models\UserModel;
use Tutor\Traits\JsonResponse;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* User class
*
Expand Down Expand Up @@ -720,6 +718,7 @@ public function ajax_switch_profile() {
}

update_user_meta( $user_id, self::VIEW_MODE_USER_META, $switch_mode );
flush_rewrite_rules();

// translators:%s for switching mode.
$this->response_success( sprintf( __( 'Profile switched to %s!', 'tutor' ), $switch_mode ) );
Expand Down
Loading