Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/src/floating.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class Floating {
///
/// Note: this will not make any effect on Android SDK older than 26.
Future<PiPStatus> enable(EnableArguments arguments) async {
lastEnableArguments = arguments;
final (aspectRatio, sourceRectHint, autoEnable) = switch (arguments) {
ImmediatePiP(:final aspectRatio, :final sourceRectHint) => (
aspectRatio,
Expand All @@ -139,6 +138,11 @@ class Floating {
// current ones, e.g. current one is ImmediatePiP but OnLeavePiP
// was called before.
await cancelOnLeavePiP();

// Moved this here as setting it on the first line does not make sense since
// it will be overridden by the cancelOnLeavePiP call.
lastEnableArguments = arguments;

final bool? enabledSuccessfully = await _channel.invokeMethod(
'enablePip',
{
Expand Down
Loading