Skip to content

Commit 02d1e06

Browse files
committed
Check if the notice can be dismissed not in the command
1 parent fb94c3b commit 02d1e06

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

wcfsetup/install/files/lib/command/notice/DismissNotice.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ public function __construct(
2424

2525
public function __invoke(): void
2626
{
27-
if (!$this->notice->isDismissible) {
28-
return;
29-
}
30-
3127
if (WCF::getUser()->userID) {
3228
$this->dismissForUser($this->notice, WCF::getUser()->userID);
3329
} else {

wcfsetup/install/files/lib/data/notice/NoticeAction.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public function dismiss()
8282
{
8383
$editor = $this->getSingleObject();
8484

85-
(new DismissNotice($editor->getDecoratedObject()))();
85+
if ($editor->isDismissible) {
86+
(new DismissNotice($editor->getDecoratedObject()))();
87+
}
8688

8789
return [
8890
'noticeID' => \reset($this->objectIDs),

0 commit comments

Comments
 (0)