Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 8 additions & 7 deletions assets/apps/dashboard/src/Components/Content/AvailableModule.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* global neveDash */
import { __, sprintf } from '@wordpress/i18n';
import { __ } from '@wordpress/i18n';
import {
NEVE_AVAILABLE_MODULES_ICON_MAP,
NEVE_STORE,
Expand Down Expand Up @@ -42,10 +42,8 @@ const ModuleToggle = ({
const { api } = neveDash;
const { title } = moduleData;
const toastMessage = {
//translators: %s - Plugin name
installing: sprintf(__('Installing %s', 'neve'), 'Orbit Fox Plugin'),
//translators: %s - Plugin name
activating: sprintf(__('Activating %s', 'neve'), 'Orbit Fox Plugin'),
installing: __('Installing', 'neve'),
activating: __('Activating', 'neve'),
};

const handleToggle = async (value) => {
Expand Down Expand Up @@ -90,7 +88,10 @@ const ModuleToggle = ({
);
} catch (error) {
setToast(
__('Something went wrong while activating the module.', 'neve')
__(
'Something went wrong. Please reload the page and try again.',
'neve'
)
);
} finally {
setLoading(false);
Expand Down Expand Up @@ -154,7 +155,7 @@ const AvailableModuleCard = ({
className="flex mt-2 text-blue-600 gap-2 align-middle"
href="admin.php?page=obfx_companion"
>
{__('Go to Settings to Edit', 'neve')}
{__('Settings', 'neve')}
<ArrowRight size={18} />
</a>
)}
Expand Down
6 changes: 3 additions & 3 deletions inc/core/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public function activate_plugin( $request ) {
}

if ( ! isset( $api->download_link ) ) {
wp_send_json_error( array( 'message' => __( 'Invalid plugin information.', 'neve' ) ) );
wp_send_json_error( array( 'message' => __( 'Invalid action', 'neve' ) ) );
}

$skin = new \WP_Ajax_Upgrader_Skin();
Expand Down Expand Up @@ -461,12 +461,12 @@ public function activate_module( $request ) {
$modules = $settings::$instance->module_objects;

if ( ! isset( $modules[ $module_slug ] ) ) {
wp_send_json_error( __( 'Invalid module slug.', 'neve' ) );
wp_send_json_error( __( 'Invalid action', 'neve' ) );
}

$response = $modules[ $module_slug ]->set_status( 'active', $module_value );

wp_send_json_success( __( 'Module status changed.', 'neve' ) );
wp_send_json_success( $module_value ? __( 'Module Activated', 'neve' ) : __( 'Module Deactivated.', 'neve' ) );
}

/**
Expand Down
Loading