Skip to content

Commit 87bde1b

Browse files
committed
Check if the notice can be dismissed not in the command
1 parent b03a2e6 commit 87bde1b

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

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
@@ -81,7 +81,9 @@ public function dismiss()
8181
{
8282
$editor = $this->getSingleObject();
8383

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

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

0 commit comments

Comments
 (0)