Fix transfer stats #458 (#501)

* fix: notification fixed for android 13

* fix: join trigger flow changed

* fix: home screen bg color fixed

* fix: bg color fixed on dismiss tap

* chore: webview navigation improved

* chore: announcement animation changed

* chore: device and user info added in client email

* chore: testing abc icon removed

* chore: animation re-rendering fixed

* chore: menu bottom closing issue fixed

* chore: fixed banner

* chore: app version updated

* fix: email issue on share

* chore: animation removed

* fix: player overlay image dimensions fixed

* fix: refresh behaviour fixed

* fix: email content and new line issue fixed

* fix: new announcement fixed

* Merge branch 'client-email-navigation' into animate-row-items#431

* chore: sentry logs added

* fix: overlay image fixed

* chore: announcement animation fixed

* Merge branch 'animate-row-items#431' into player-image-is-not-square#443

* chore: meditation renamed to track

* chore: sentry exception added on player

* chore: audio extension fixed

* chore: app version updated

* chore: fixed downloading audio from another screen

* chore: app version updated

* chore: dummy stats added for testing

* chore: sentry exception added on stats

* Merge branch 'add-sentry' into renaming-meditation-to-tracks

* chore: unnecessary code removed

---------

Co-authored-by: Michael Speed <michaelcspeed@users.noreply.github.com>
This commit is contained in:
Osama Asif 2023-10-06 14:08:39 +05:00 committed by GitHub
parent ef04babb47
commit caa16559e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 10 deletions

View File

@ -42,6 +42,7 @@
<activity
android:name="com.ryanheise.audioservice.AudioServiceActivity"
android:exported="true"
android:allowBackup="false"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"

View File

@ -79,7 +79,6 @@ String? encoded(obj) {
//ignore:avoid-dynamic
dynamic decoded(String obj) {
return json.decode(obj);
}

View File

@ -49,8 +49,11 @@ class PostLocalStatsNotifier
payload: statsModel.toJson(),
);
try {
await ref.read(eventsProvider(event: event.toJson()).future);
await statsProvider.removeStatsFromPreference();
await ref
.read(eventsProvider(event: event.toJson()).future)
.then((_) async {
await statsProvider.removeStatsFromPreference();
});
} catch (e) {
rethrow;
}

View File

@ -3,6 +3,7 @@ import 'package:Medito/services/network/dio_api_service.dart';
import 'package:Medito/services/network/dio_client_provider.dart';
import 'package:Medito/utils/stats_utils.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:Medito/models/models.dart';
@ -59,7 +60,11 @@ class StatsRepositoryImpl extends StatsRepository {
}
return null;
} catch (e) {
} catch (err) {
await Sentry.captureException(
err,
stackTrace: err.toString(),
);
rethrow;
}
}
@ -82,12 +87,15 @@ class StatsRepositoryImpl extends StatsRepository {
await pref.remove('secsListened');
await pref.remove('numSessions');
await pref.remove('longestStreak');
} catch (e) {
} catch (err) {
await Sentry.captureException(
err,
stackTrace: err.toString(),
);
rethrow;
}
}
}
@riverpod
StatsRepository statsRepository(ref) {
return StatsRepositoryImpl(client: ref.watch(dioClientProvider));

View File

@ -173,8 +173,7 @@ class _RootPageViewState extends ConsumerState<RootPageView> {
String trackId,
String audioFileId,
) {
var audio =
AudioStartedModel(audioFileId: audioFileId, trackId: trackId);
var audio = AudioStartedModel(audioFileId: audioFileId, trackId: trackId);
var event = EventsModel(
name: EventTypes.audioStarted,
payload: audio.toJson(),

View File

@ -35,7 +35,7 @@ String getUnits(UnitType type, int _) {
Future<String> getCurrentStreak() async {
var prefs = await SharedPreferences.getInstance();
var streak = prefs.getInt('streakCount') ?? 0;
var streakList = await getStreakList();
@ -162,7 +162,7 @@ Future<String> getMinutesListened() async {
var prefs = await SharedPreferences.getInstance();
var streak = prefs.getInt('secsListened');
return streak == null ? '0' : Duration(seconds: streak).inMinutes.toString();
}