Skip to content

Conversation

@dev-aman
Copy link

What

Fix to avoid lastEnableArguments to be set to null due to cancelOnLeavePiP call

Why

This will avoid the case where pip status is always disabled and not automatic when it should be automatic post pip is enabled but not visible. (with respect to on LeavePIP)

@dev-aman dev-aman requested a review from wrbl606 as a code owner July 15, 2025 12:57
@wrbl606 wrbl606 requested a review from Copilot July 15, 2025 15:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that lastEnableArguments is set only after cancelOnLeavePiP() completes, preventing it from being cleared by that call.

  • Removed the early assignment of lastEnableArguments at the start of enable()
  • Added assignment of lastEnableArguments after cancelOnLeavePiP() with a descriptive comment
Comments suppressed due to low confidence (2)

lib/src/floating.dart:144

  • [nitpick] Add a unit test to verify that after calling enable(), lastEnableArguments retains the passed arguments and is not reset by cancelOnLeavePiP().
    lastEnableArguments = arguments;

lib/src/floating.dart:142

  • [nitpick] The comment could be more concise. For example: "Assign lastEnableArguments after cancelOnLeavePiP() to avoid it being overridden."
    // Moved this here as setting it on the first line does not make sense since

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants