mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
@@ -13,7 +13,7 @@ abstract class CommonWhisperController<R>
|
||||
SessionPageType get sessionPageType;
|
||||
|
||||
Future<void> onRemove(int index, int talkerId) async {
|
||||
var res = await MsgHttp.removeMsg(talkerId);
|
||||
final res = await MsgHttp.removeMsg(talkerId);
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeAt(index)
|
||||
@@ -30,7 +30,7 @@ abstract class CommonWhisperController<R>
|
||||
bool isTop,
|
||||
SessionId sessionId,
|
||||
) async {
|
||||
var res = isTop
|
||||
final res = isTop
|
||||
? await ImGrpc.unpinSession(sessionId: sessionId)
|
||||
: await ImGrpc.pinSession(sessionId: sessionId);
|
||||
|
||||
@@ -48,7 +48,7 @@ abstract class CommonWhisperController<R>
|
||||
}
|
||||
|
||||
Future<void> onSetMute(Session item, bool isMuted, Int64 talkerUid) async {
|
||||
var res = await MsgHttp.setMsgDnd(
|
||||
final res = await MsgHttp.setMsgDnd(
|
||||
uid: Accounts.main.mid,
|
||||
setting: isMuted ? 0 : 1,
|
||||
dndUid: talkerUid,
|
||||
@@ -68,7 +68,7 @@ abstract class CommonWhisperController<R>
|
||||
if (loadingState.value.isSuccess) {
|
||||
List<Session>? list = loadingState.value.data;
|
||||
if (list != null && list.isNotEmpty) {
|
||||
for (var item in list) {
|
||||
for (final item in list) {
|
||||
if (item.hasUnread()) {
|
||||
item.clearUnread();
|
||||
}
|
||||
@@ -83,7 +83,7 @@ abstract class CommonWhisperController<R>
|
||||
}
|
||||
|
||||
Future<void> onDeleteList() async {
|
||||
var res = await ImGrpc.deleteSessionList(pageType: sessionPageType);
|
||||
final res = await ImGrpc.deleteSessionList(pageType: sessionPageType);
|
||||
if (res.isSuccess) {
|
||||
loadingState.value = const Success(null);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user