public function canShowBlock()
{
if ($this->moduleManager->isEnabled('Magento_Staging')) {
try {
$versionManager = $this->objectManager->get('\\Magento\\Staging\\Model\\VersionManager');
return parent::canShowBlock() && !$versionManager->isPreviewVersion();
} catch (\Exception $exception) {
return parent::canShowBlock();
}
}
return parent::canShowBlock();
}