Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Oct 25, 2023
2 parents c3937a6 + 98c1171 commit b3e120d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
12 changes: 11 additions & 1 deletion lib/ui/app/live_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';

// Flutter imports:
import 'package:flutter/widgets.dart';
import 'package:window_manager/window_manager.dart';

class LiveText extends StatefulWidget {
const LiveText(
Expand All @@ -29,7 +30,16 @@ class _LiveTextState extends State<LiveText> {
super.initState();
_timer = Timer.periodic(
widget.duration ?? Duration(milliseconds: 100),
(Timer timer) => mounted ? setState(() => false) : false,
(Timer timer) async {
final isFocused = await windowManager.isFocused();
if (!isFocused) {
return;
}

if (mounted) {
setState(() => false);
}
},
);
}

Expand Down
11 changes: 10 additions & 1 deletion lib/ui/app/upgrade_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,17 @@ class _UpgradeDialogState extends State<UpgradeDialog> {
final url = (state.isStaging ? kAppStagingUrl : kAppProductionUrl) +
'/api/admin/subscription';

var purchaseID = purchaseDetails.purchaseID;
if (purchaseDetails is AppStorePurchaseDetails) {
final originalTransaction =
purchaseDetails.skPaymentTransaction.originalTransaction;
if (originalTransaction != null) {
purchaseID = originalTransaction.transactionIdentifier;
}
}

final data = {
'inapp_transaction_id': purchaseDetails.purchaseID,
'inapp_transaction_id': purchaseID,
'key': state.account.key,
'plan': purchaseDetails.productID.replaceAll('-', '_'),
'plan_paid': (int.parse(purchaseDetails.transactionDate!) / 1000).floor(),
Expand Down

0 comments on commit b3e120d

Please sign in to comment.