🐛 Fix and optimize something
This commit is contained in:
parent
92354eee34
commit
a303f5c30c
@ -477,7 +477,7 @@
|
||||
DEVELOPMENT_TEAM = W7HPZ53V6B;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = SolarAgent;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = Solian;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -666,7 +666,7 @@
|
||||
DEVELOPMENT_TEAM = W7HPZ53V6B;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = SolarAgent;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = Solian;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -693,7 +693,7 @@
|
||||
DEVELOPMENT_TEAM = W7HPZ53V6B;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = SolarAgent;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = Solian;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -27,6 +27,7 @@ class AuthGuard {
|
||||
static const profileKey = "profiles";
|
||||
|
||||
oauth2.Client? client;
|
||||
DateTime? lastRefreshedAt;
|
||||
|
||||
Future<bool> pickClient() async {
|
||||
if (await storage.containsKey(key: storageKey)) {
|
||||
@ -110,7 +111,13 @@ class AuthGuard {
|
||||
const storage = FlutterSecureStorage();
|
||||
if (await storage.containsKey(key: storageKey)) {
|
||||
if (client != null) {
|
||||
if (lastRefreshedAt == null ||
|
||||
lastRefreshedAt!
|
||||
.add(const Duration(minutes: 3))
|
||||
.isAfter(DateTime.now())) {
|
||||
await refreshToken();
|
||||
lastRefreshedAt = DateTime.now();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
|
@ -74,8 +74,18 @@ class _ReactionListState extends State<ReactionList> {
|
||||
);
|
||||
if (res.statusCode == 201) {
|
||||
widget.onReact(symbol, 1);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text("Your reaction has been added onto this post."),
|
||||
),
|
||||
);
|
||||
} else if (res.statusCode == 204) {
|
||||
widget.onReact(symbol, -1);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text("Your reaction has been removed from this post."),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
var message = utf8.decode(res.bodyBytes);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@ -105,10 +115,7 @@ class _ReactionListState extends State<ReactionList> {
|
||||
),
|
||||
child: Text(
|
||||
'Reactions',
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.headlineSmall,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
),
|
||||
FutureBuilder(
|
||||
@ -150,8 +157,7 @@ class _ReactionListState extends State<ReactionList> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6.0),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
"${ReactionList.emojis[element.key]!['icon']} x${element
|
||||
.value.toString()}",
|
||||
"${ReactionList.emojis[element.key]!['icon']} x${element.value.toString()}",
|
||||
),
|
||||
subtitle: Text(
|
||||
":${element.key}:",
|
||||
|
Reference in New Issue
Block a user