Skip to content

Commit

Permalink
Simplify setup notification check requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaemnnosttv committed Jan 10, 2025
1 parent 0889c1b commit c2172ee
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions assets/js/modules/reader-revenue-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,17 @@ export const NOTIFICATIONS = {
// Check if the prompt with the legacy key used before the banner was refactored
// to use the `notification ID` as the dismissal key, is dismissed.
await resolveSelect( CORE_USER ).getDismissedPrompts();
const isDismissed = select( CORE_USER ).isPromptDismissed(
const isLegacyDismissed = select( CORE_USER ).isPromptDismissed(
LEGACY_RRM_SETUP_BANNER_DISMISSED_KEY
);

const canActivateRRMModule = await resolveSelect(
CORE_MODULES
).canActivateModule( READER_REVENUE_MANAGER_MODULE_SLUG );

if ( isDismissed === false && canActivateRRMModule ) {
return true;
if ( isLegacyDismissed ) {
return false;
}

return false;
return await resolveSelect( CORE_MODULES ).canActivateModule(
READER_REVENUE_MANAGER_MODULE_SLUG
);
},
isDismissible: true,
dismissRetries: 1,
Expand Down

0 comments on commit c2172ee

Please sign in to comment.