mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: use cached coin (#667)
This commit is contained in:
committed by
GitHub
parent
1eadcd41f6
commit
02dee71670
@@ -45,11 +45,16 @@ class Request {
|
||||
)));
|
||||
|
||||
if (Accounts.main.isLogin) {
|
||||
getCoin();
|
||||
final coin = GStorage.userInfo.get('userInfoCache')?.money;
|
||||
if (coin == null) {
|
||||
setCoin();
|
||||
} else {
|
||||
GlobalData().coins = coin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Future getCoin() async {
|
||||
static Future<void> setCoin() async {
|
||||
final res = await UserHttp.getCoin();
|
||||
if (res['status']) {
|
||||
GlobalData().coins = res['data'];
|
||||
|
||||
Reference in New Issue
Block a user