Skip to content

Commit

Permalink
Fixed stats chart alignment and timeout settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuito83 committed May 31, 2024
1 parent 15dedb7 commit fb7eda1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (localPropertiesFile.exists()) {

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '425'
flutterVersionCode = '426'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
Expand Down
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 425;
CURRENT_PROJECT_VERSION = 426;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 53KVJRJS99;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -671,7 +671,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 425;
CURRENT_PROJECT_VERSION = 426;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 53KVJRJS99;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -709,7 +709,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 425;
CURRENT_PROJECT_VERSION = 426;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 53KVJRJS99;
ENABLE_BITCODE = NO;
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ import 'package:workmanager/workmanager.dart';

// TODO (App release)
const String appVersion = '3.4.2';
const String androidCompilation = '425';
const String iosCompilation = '425';
const String androidCompilation = '426';
const String iosCompilation = '426';

// TODO (App release)
const bool pointFunctionsEmulatorToLocal = false;
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/changelog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ class ChangeLogState extends State<ChangeLog> {
void _createItems() {
final itemList = <ChangeLogItem>[];

// v3.4.2 - Build 425 - 26/05/2024
// v3.4.2 - Build 426 - 31/05/2024
itemList.add(
ChangeLogItem()
..version = 'Torn PDA v3.4.2'
..date = '01 JUN 2024'
..date = '04 JUN 2024'
..features = [
"Added traveling filter in War",
"Added highlight for user's own OC [Kwack]",
Expand Down
7 changes: 5 additions & 2 deletions lib/widgets/profile/stats_chart.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:math';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -84,7 +85,7 @@ class _StatsChartState extends State<StatsChart> {
try {
final String tornStatsURL =
'https://www.tornstats.com/api/v2/${widget.userController.alternativeTornStatsKey}/battlestats/record';
final resp = await http.get(Uri.parse(tornStatsURL)).timeout(const Duration(seconds: 5));
final resp = await http.get(Uri.parse(tornStatsURL)).timeout(const Duration(seconds: 10));
if (resp.statusCode == 200) {
final TornStatsChartUpdate statsJson = tornStatsChartUpdateFromJson(resp.body);
if (statsJson.status! && statsJson.message != null) {
Expand All @@ -93,6 +94,8 @@ class _StatsChartState extends State<StatsChart> {
widget.callbackStatsUpdate();
}
}
} on TimeoutException {
message = "Error updating stats: Torn Stats did not respond, it might be unavailable at this time";
} catch (e) {
message = "Error updating stats: $e";
}
Expand Down Expand Up @@ -141,7 +144,7 @@ class _StatsChartState extends State<StatsChart> {
),
const SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (success)
TextButton(
Expand Down

0 comments on commit fb7eda1

Please sign in to comment.