mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: dyn red
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPalaX/grpc/grpc_repo.dart';
|
||||
import 'package:PiliPalaX/http/common.dart';
|
||||
import 'package:PiliPalaX/pages/dynamics/view.dart';
|
||||
import 'package:PiliPalaX/pages/home/view.dart';
|
||||
import 'package:PiliPalaX/pages/media/view.dart';
|
||||
import 'package:PiliPalaX/utils/global_data.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
@@ -57,11 +59,19 @@ class MainController extends GetxController {
|
||||
if (!userLogin.value || dynIndex == -1) {
|
||||
return;
|
||||
}
|
||||
await GrpcRepo.dynRed().then((res) {
|
||||
if (res['status']) {
|
||||
setCount(res['data']);
|
||||
}
|
||||
});
|
||||
if (GlobalData().grpcReply) {
|
||||
await GrpcRepo.dynRed().then((res) {
|
||||
if (res['status']) {
|
||||
setCount(res['data']);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
await CommonHttp.unReadDynamic().then((res) {
|
||||
if (res['status']) {
|
||||
setCount(res['data']);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void setCount([int count = 0]) async {
|
||||
|
||||
Reference in New Issue
Block a user