Pause instead of dangling when the live slide is deleted
Deleting the live slide set current_slide_id directly, so participants saw "not started", and deleting the paused slide left paused_slide_id pointing to a slide that no longer exists. Poll::forgetSlide() now pauses and resumes with the slide taking its place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8b0e82d806
commit
a7f9783a75
4 files changed
+75
-7
No files matched your search
@@ -99,6 +99,24 @@ class Poll extends Entity
|
||||
$this->embed_seen_at = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* A slide is being deleted. If it was live or is the one a pause resumes, the poll pauses
|
||||
* and resumes with $resumeSlideId instead (null: no slides left = not started). Idempotent.
|
||||
*
|
||||
* @param int $slideId Deleted slide
|
||||
* @param int|null $resumeSlideId Slide that takes its place (must belong to this poll)
|
||||
* @return void
|
||||
*/
|
||||
public function forgetSlide(int $slideId, ?int $resumeSlideId): void
|
||||
{
|
||||
if ($this->current_slide_id !== $slideId && $this->paused_slide_id !== $slideId) {
|
||||
return;
|
||||
}
|
||||
$this->current_slide_id = null;
|
||||
$this->paused_slide_id = $resumeSlideId;
|
||||
$this->embed_seen_at = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool Paused after a slide had been live (not: not started yet)
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user