From 580e6a561f7d252a94888b54c206e06ac0237c38 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 7 Dec 2022 13:02:48 +0400 Subject: [PATCH] Don't check box visibility in BoxShow. --- ui/layers/box_content.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/layers/box_content.cpp b/ui/layers/box_content.cpp index bd06178..484dffa 100644 --- a/ui/layers/box_content.cpp +++ b/ui/layers/box_content.cpp @@ -327,14 +327,14 @@ BoxShow::~BoxShow() = default; void BoxShow::showBox( object_ptr content, LayerOptions options) const { - if (_weak && _weak->isBoxShown()) { - _weak->getDelegate()->show(std::move(content), options); + if (const auto strong = _weak.data()) { + strong->getDelegate()->show(std::move(content), options); } } void BoxShow::hideLayer() const { - if (_weak && _weak->isBoxShown()) { - _weak->getDelegate()->hideLayer(); + if (const auto strong = _weak.data()) { + strong->getDelegate()->hideLayer(); } }