diff --git a/.gitignore b/.gitignore
index ddbe5584..1071fa4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@
.buildlog/
.history
.svn/
+migrate_working_dir/
# IntelliJ related
*.iml
diff --git a/README.md b/README.md
index da5ba578..862ab221 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
-
-
Frosty for Twitch
+
+
+ Frosty
+
@@ -11,7 +13,6 @@
Flutter.
-
7.10.1)
+ - Sentry (~> 7.11.0)
- shared_preferences_ios (0.0.1):
- Flutter
- sqflite (0.0.2):
@@ -80,8 +80,8 @@ SPEC CHECKSUMS:
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
- Sentry: 7bf9bfe713692cf87812e55f0999260494ba7982
- sentry_flutter: 77ccdac346608b8ce7e428e7284e7a3e4e7f4a02
+ Sentry: 0c5cd63d714187b4a39c331c1f0eb04ba7868341
+ sentry_flutter: efb3df2c203cd03aad255892a8d628a458656d14
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index e5a14f8f..983b0c25 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -52,5 +52,7 @@
UIStatusBarHidden
-
-
\ No newline at end of file
+ CADisableMinimumFrameDurationOnPhone
+
+
+
diff --git a/lib/api/ffz_api.dart b/lib/api/ffz_api.dart
index 85e15fbf..1249466c 100644
--- a/lib/api/ffz_api.dart
+++ b/lib/api/ffz_api.dart
@@ -33,8 +33,8 @@ class FFZApi {
}
/// Returns a channel's FFZ room info including custom badges and emote used.
- Future>> getRoomInfo({required String name}) async {
- final url = Uri.parse('https://api.frankerfacez.com/v1/room/$name');
+ Future>> getRoomInfo({required String id}) async {
+ final url = Uri.parse('https://api.frankerfacez.com/v1/room/id/$id');
final response = await _client.get(url);
if (response.statusCode == 200) {
diff --git a/lib/api/seventv_api.dart b/lib/api/seventv_api.dart
index f21eea19..0033c99c 100644
--- a/lib/api/seventv_api.dart
+++ b/lib/api/seventv_api.dart
@@ -26,8 +26,8 @@ class SevenTVApi {
}
/// Returns a map of a channel's 7TV emotes to their URL.
- Future> getEmotesChannel({required String user}) async {
- final url = Uri.parse('https://api.7tv.app/v2/users/$user/emotes');
+ Future> getEmotesChannel({required String id}) async {
+ final url = Uri.parse('https://api.7tv.app/v2/users/$id/emotes');
final response = await _client.get(url);
if (response.statusCode == 200) {
diff --git a/lib/core/auth/auth_store.dart b/lib/core/auth/auth_store.dart
index 1e19be2e..ee296a0f 100644
--- a/lib/core/auth/auth_store.dart
+++ b/lib/core/auth/auth_store.dart
@@ -8,9 +8,9 @@ import 'package:mobx/mobx.dart';
part 'auth_store.g.dart';
-class AuthStore = _AuthBase with _$AuthStore;
+class AuthStore = AuthBase with _$AuthStore;
-abstract class _AuthBase with Store {
+abstract class AuthBase with Store {
/// Secure storage to store tokens.
static const _storage = FlutterSecureStorage();
@@ -44,7 +44,7 @@ abstract class _AuthBase with Store {
@readonly
String? _error;
- _AuthBase({required this.twitchApi}) : user = UserStore(twitchApi: twitchApi);
+ AuthBase({required this.twitchApi}) : user = UserStore(twitchApi: twitchApi);
/// Initialize by retrieving a token if it does not already exist.
@action
@@ -58,8 +58,8 @@ abstract class _AuthBase with Store {
if (_token == null) {
// Retrieve the currently stored default token if it exists.
_token = await _storage.read(key: _defaultTokenKey);
- // If the token does not exist, get a new token and store it.
- if (_token == null) {
+ // If the token does not exist or is invalid, get a new token and store it.
+ if (_token == null || !await twitchApi.validateToken(token: _token!)) {
_token = await twitchApi.getDefaultToken();
await _storage.write(key: _defaultTokenKey, value: _token);
}
@@ -127,7 +127,7 @@ abstract class _AuthBase with Store {
await user.init(headers: headersTwitch);
// Set the login status to logged in.
- _isLoggedIn = true;
+ if (user.details != null) _isLoggedIn = true;
} catch (error) {
debugPrint('Login failed due to $error');
}
@@ -147,20 +147,10 @@ abstract class _AuthBase with Store {
// If the default token already exists, set it.
_token = await _storage.read(key: _defaultTokenKey);
- // If the default token does not already exist, get the new default token and store it.
- // Else, validate the existing token.
- if (_token == null) {
+ // If the default token does not already exist or it's invalid, get the new default token and store it.
+ if (_token == null || !await twitchApi.validateToken(token: _token!)) {
_token = await twitchApi.getDefaultToken();
await _storage.write(key: _defaultTokenKey, value: _token);
- } else {
- // Validate the stored token.
- _tokenIsValid = await twitchApi.validateToken(token: _token!);
-
- // If the stored token is invalid, get a new default token and store it.
- if (!_tokenIsValid) {
- _token = await twitchApi.getDefaultToken();
- await _storage.write(key: _defaultTokenKey, value: _token);
- }
}
// Set the login status to logged out.
diff --git a/lib/core/auth/auth_store.g.dart b/lib/core/auth/auth_store.g.dart
index afb167c2..c7a3e505 100644
--- a/lib/core/auth/auth_store.g.dart
+++ b/lib/core/auth/auth_store.g.dart
@@ -6,18 +6,18 @@ part of 'auth_store.dart';
// StoreGenerator
// **************************************************************************
-// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
+// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic, no_leading_underscores_for_local_identifiers
-mixin _$AuthStore on _AuthBase, Store {
+mixin _$AuthStore on AuthBase, Store {
Computed