Skip to content

Commit 1261d86

Browse files
committed
Update update check condition
1 parent 420f7be commit 1261d86

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugin/assets/src/settings/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const UPDATERS = {
5656
type: 'PLUGIN',
5757
lastUpdated: false,
5858
needsKey: false,
59-
updateAvailable: '0' !== String( getConfig( 'pluginUpdateStatus' ) ),
59+
updateAvailable: !! String( getConfig( 'pluginUpdateStatus' ) ),
6060
versionAvailable: getConfig( 'pluginUpdateStatus' ),
6161
autoUpdates: parseInt( getConfig( 'pluginAutoUpdate' ) || 0, 10 ),
6262
displayUpdatedOn: false,
@@ -66,7 +66,7 @@ export const UPDATERS = {
6666
type: 'THEME',
6767
lastUpdated: false,
6868
needsKey: false,
69-
updateAvailable: '0' !== String( getConfig( 'themeUpdateStatus' ) ),
69+
updateAvailable: !! String( getConfig( 'themeUpdateStatus' ) ),
7070
versionAvailable: getConfig( 'themeUpdateStatus' ),
7171
autoUpdates: parseInt( getConfig( 'themeAutoUpdate' ) || 0, 10 ),
7272
displayUpdatedOn: false,

plugin/php/class-admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ public function enqueue_assets() {
293293
$plugin_updates = get_site_transient( 'update_plugins' );
294294
$theme_updates = get_site_transient( 'update_themes' );
295295

296-
$plugin_status = isset( $plugin_updates->response[ $plugin_file ] ) ? ( (array) $plugin_updates->response[ $plugin_file ] )['new_version'] : 0;
297-
$theme_status = isset( $theme_updates->response[ Plugin::THEME_SLUG ] ) ? ( (array) $theme_updates->response[ Plugin::THEME_SLUG ] )['new_version'] : 0;
296+
$plugin_status = isset( $plugin_updates->response[ $plugin_file ] ) ? ( (array) $plugin_updates->response[ $plugin_file ] )['new_version'] : '';
297+
$theme_status = isset( $theme_updates->response[ Plugin::THEME_SLUG ] ) ? ( (array) $theme_updates->response[ Plugin::THEME_SLUG ] )['new_version'] : '';
298298

299299
wp_localize_script(
300300
'material-settings',

0 commit comments

Comments
 (0)