Skip to content

Commit

Permalink
fix: hide the license field when pro is not active
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Jul 11, 2024
1 parent 382a92f commit f3b2318
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
16 changes: 8 additions & 8 deletions includes/admin/class-rop-global-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,18 +456,18 @@ public function get_license_data() {
* @return array With data for display.
*/
public function get_license_data_view() {
$license_data = $this->get_license_data();
$license_data = $this->get_license_data();
$view_license_data = array(
'installed' => defined( 'ROP_PRO_VERSION' ),
'license' => 'invalid',
'expires' => '',
'passwordMask' => '',
);

if ( -1 === $license_data ) {
return array(
'license' => 'invalid',
'expires' => '',
'passwordMask' => '',
);
return $view_license_data;
}

$view_license_data = array();

// Pick only the necessary data.
if ( isset( $license_data->license ) ) {
$view_license_data['license'] = $license_data->license;
Expand Down
5 changes: 4 additions & 1 deletion vue/src/vue-elements/main-page-panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@
target="_blank"
class="btn rop-sidebar-action-btns"
>{{ labels.review_it }}</a>
<div class="license-container">
<div
v-if="license_data_view.installed"
class="license-container"
>
<h6 class="license-title">
{{ license_field_title }}
</h6>
Expand Down

0 comments on commit f3b2318

Please sign in to comment.