Skip to content

Commit 00f73aa

Browse files
authored
Merge pull request #300 from Manuito83/develop
Merge for v3.6.3
2 parents c720e21 + 264efb9 commit 00f73aa

File tree

11 files changed

+470
-395
lines changed

11 files changed

+470
-395
lines changed

android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ if (localPropertiesFile.exists()) {
1616

1717
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1818
if (flutterVersionCode == null) {
19-
flutterVersionCode = '467'
19+
flutterVersionCode = '470'
2020
}
2121

2222
def flutterVersionName = localProperties.getProperty('flutter.versionName')
2323
if (flutterVersionName == null) {
24-
flutterVersionName = '3.6.2'
24+
flutterVersionName = '3.6.3'
2525
}
2626

2727
def keystoreProperties = new Properties()

ios/Runner.xcodeproj/project.pbxproj

+56-56
Large diffs are not rendered by default.

lib/drawer.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ class DrawerPageState extends State<DrawerPage> with WidgetsBindingObserver, Aut
672672
logToUser(
673673
"Deep link browser opens\n\n$url",
674674
duration: 3,
675-
color: Colors.blue.shade600,
675+
backgroundcolor: Colors.blue.shade600,
676676
borderColor: Colors.blue.shade800,
677677
);
678678

lib/main.dart

+25-11
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ import 'package:wakelock_plus/wakelock_plus.dart';
6868
import 'package:workmanager/workmanager.dart';
6969

7070
// TODO (App release)
71-
const String appVersion = '3.6.2';
72-
const String androidCompilation = '467';
73-
const String iosCompilation = '467';
71+
const String appVersion = '3.6.3';
72+
const String androidCompilation = '470';
73+
const String iosCompilation = '470';
7474

7575
// TODO (App release)
7676
// Note: if using Windows and calling HTTP functions, we need to change the URL in [firebase_functions.dart]
@@ -553,6 +553,13 @@ class MyAppState extends State<MyApp> with WidgetsBindingObserver {
553553
if (!splitNowActive && splitUserEnabled && screenIsWide) {
554554
_webViewProvider.webViewSplitActive = true;
555555
_webViewProvider.browserForegroundWithSplitTransition();
556+
557+
// Chat notifications should be omitted when switching into splitview
558+
// (note: the case where we are no longer in splitiew is handled below,
559+
// by notifying the webviewProvider with true/false which in turns
560+
// will update the Sendbird Controller with the right value)
561+
SendbirdController sb = Get.find<SendbirdController>();
562+
sb.webviewInForeground = true;
556563
} else if (splitNowActive && (!splitUserEnabled || !screenIsWide)) {
557564
_webViewProvider.webViewSplitActive = false;
558565
if (_webViewProvider.splitScreenRevertsToApp) {
@@ -682,14 +689,21 @@ Future<void> _shouldSyncDeviceTheme(WidgetsBinding widgetsBinding) async {
682689
}
683690
}
684691

685-
logToUser(String? message, {int duration = 3, Color? color, Color? borderColor}) {
692+
logToUser(
693+
String? message, {
694+
int duration = 3,
695+
Color? textColor,
696+
Color? backgroundcolor,
697+
Color? borderColor,
698+
}) {
686699
log(message.toString());
687700
if (message == null) return;
688-
color ??= Colors.red.shade600;
701+
backgroundcolor ??= Colors.red.shade600;
689702
borderColor ??= Colors.red.shade800;
703+
textColor ??= Colors.white;
690704
if (logAndShowToUser) {
691705
toastification.showCustom(
692-
autoCloseDuration: const Duration(seconds: 3),
706+
autoCloseDuration: Duration(seconds: duration),
693707
alignment: Alignment.bottomCenter,
694708
builder: (BuildContext context, ToastificationItem holder) {
695709
return Center(
@@ -698,15 +712,15 @@ logToUser(String? message, {int duration = 3, Color? color, Color? borderColor})
698712
child: Container(
699713
decoration: BoxDecoration(
700714
borderRadius: BorderRadius.circular(8),
701-
color: color,
715+
color: backgroundcolor,
702716
border: Border.all(color: borderColor!, width: 2),
703717
),
704-
padding: const EdgeInsets.all(16),
705-
margin: const EdgeInsets.all(8),
718+
padding: const EdgeInsets.all(8),
719+
margin: const EdgeInsets.all(2),
706720
child: Column(
707721
children: [
708-
Text("Debug Message\n", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
709-
Text(message.toString(), maxLines: 10, style: TextStyle(color: Colors.white)),
722+
Text("Debug Message\n", style: TextStyle(color: textColor, fontWeight: FontWeight.bold)),
723+
Text(message.toString(), maxLines: 10, style: TextStyle(color: textColor)),
710724
],
711725
),
712726
)),

lib/pages/travel/foreign_stock_page.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ class ForeignStockPageState extends State<ForeignStockPage> {
929929
logToUser(
930930
apiReturn.providersMessage,
931931
duration: 4,
932-
color: Colors.blue.shade600,
932+
backgroundcolor: Colors.blue.shade600,
933933
borderColor: Colors.blue.shade800,
934934
);
935935
}

lib/providers/periodic_execution_controller.dart

+27-17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:developer';
2+
13
import 'package:get/get.dart';
24
import 'package:torn_pda/utils/shared_prefs.dart';
35

@@ -17,21 +19,25 @@ class PeriodicExecutionController extends GetxController {
1719
bool executeImmediately = false,
1820
bool overwrite = false,
1921
}) async {
20-
// If overwrite is enabled, remove the existing task
21-
if (_tasks.containsKey(taskName) && overwrite) {
22-
await cancelTask(taskName); // Remove the existing task
23-
}
22+
try {
23+
// If overwrite is enabled, remove the existing task
24+
if (_tasks.containsKey(taskName) && overwrite) {
25+
await cancelTask(taskName); // Remove the existing task
26+
}
2427

25-
// Ensure the taskName is unique
26-
if (_tasks.containsKey(taskName)) {
27-
throw Exception('Task with name "$taskName" already exists');
28-
}
28+
// Ensure the taskName is unique
29+
if (_tasks.containsKey(taskName)) {
30+
throw Exception('Task with name "$taskName" already exists');
31+
}
2932

30-
_tasks[taskName] = _TaskDetails(task, intervalInHours);
33+
_tasks[taskName] = _TaskDetails(task, intervalInHours);
3134

32-
if (executeImmediately) {
33-
await task();
34-
await _updateLastExecutionTime(taskName);
35+
if (executeImmediately) {
36+
await task();
37+
await _updateLastExecutionTime(taskName);
38+
}
39+
} catch (e) {
40+
log("$e", name: "Periodic Execution Controller");
3541
}
3642
}
3743

@@ -57,13 +63,17 @@ class PeriodicExecutionController extends GetxController {
5763

5864
/// Cancels a task by its name and removes its execution state
5965
Future<void> cancelTask(String taskName) async {
60-
if (!_tasks.containsKey(taskName)) {
61-
throw Exception('Task "$taskName" is not registered');
62-
}
66+
try {
67+
if (!_tasks.containsKey(taskName)) {
68+
throw Exception('Task "$taskName" is not registered');
69+
}
6370

64-
_tasks.remove(taskName);
71+
_tasks.remove(taskName);
6572

66-
await Prefs().removeLastExecutionTime(taskName);
73+
await Prefs().removeLastExecutionTime(taskName);
74+
} catch (e) {
75+
log("$e", name: "Periodic Execution Controller");
76+
}
6777
}
6878

6979
/// Updates the last execution time for a given task

lib/providers/sendbird_controller.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class SendbirdController extends GetxController {
178178
);
179179

180180
if (regStatus == PushTokenRegistrationStatus.success) {
181-
logToUser("Successfully registered user FCM token with Sendbird!");
181+
log("Successfully registered user FCM token with Sendbird!");
182182

183183
// Ensure it's not just mentions
184184
await SendbirdChat.setPushTriggerOption(PushTriggerOption.all);

lib/utils/changelog.dart

+13-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,22 @@ class ChangeLogState extends State<ChangeLog> {
5151
void _createItems() {
5252
final itemList = <ChangeLogItem>[];
5353

54-
// v3.6.2 - Build 467 - 87/11/2024
54+
// v3.6.3 - Build 470 - 12/12/2024
55+
itemList.add(
56+
ChangeLogItem()
57+
..version = 'Torn PDA v3.6.3'
58+
..date = '25 DEC 2024'
59+
..features = [
60+
"Fixed player profile widget",
61+
"Fixed chat notifications in split screen",
62+
],
63+
);
64+
65+
// v3.6.2 - Build 467 - 07/11/2024
5566
itemList.add(
5667
ChangeLogItem()
5768
..version = 'Torn PDA v3.6.2'
58-
..date = '9 DEC 2024'
69+
..date = '09 DEC 2024'
5970
..infoString = 'Hotfix: resolved an issue affecting the reordering of tabs'
6071
..features = [
6172
"Added channel info to chat notifications",

0 commit comments

Comments
 (0)