fix: fix UserHomeSetupListener disabling with nested events

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-04-10 20:03:11 +02:00
parent fae8add994
commit a77f8ca38c
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB
2 changed files with 5 additions and 3 deletions

View file

@ -61,7 +61,7 @@ class SharesUpdatedListener implements IEventListener {
public function handle(Event $event): void {
// don't trigger the on-setup checks if this handler triggers an fs setup
$this->homeSetupListener->setDisabled(true);
$oldState = $this->homeSetupListener->setDisabled(true);
if ($event instanceof UserShareAccessUpdatedEvent) {
foreach ($event->getUsers() as $user) {
@ -111,7 +111,7 @@ class SharesUpdatedListener implements IEventListener {
}
}
$this->homeSetupListener->setDisabled(false);
$this->homeSetupListener->setDisabled($oldState);
}
private function markOrRun(IUser $user, callable $callback): void {

View file

@ -30,8 +30,10 @@ class UserHomeSetupListener implements IEventListener {
) {
}
public function setDisabled(bool $disabled): void {
public function setDisabled(bool $disabled): bool {
$previous = $this->disabled;
$this->disabled = $disabled;
return $previous;
}
public function handle(Event $event): void {
if (!$event instanceof UserHomeSetupEvent) {