fix: get mid

This commit is contained in:
bggRGjQaUbCoE
2024-10-20 11:58:06 +08:00
parent 73076ba13a
commit 9d48072515
6 changed files with 7 additions and 6 deletions

View File

@@ -287,7 +287,7 @@ class _CreatePanelState extends State<CreatePanel> {
}
}
dynamic result = await MsgHttp.createDynamic(
mid: GStorage.userInfo.get('userInfoCache').mid,
mid: GStorage.userInfo.get('userInfoCache')?.mid,
rawText: _ctr.text,
pics: pics,
publishTime: _publishTime != null

View File

@@ -196,7 +196,7 @@ class _RepostPanelState extends State<RepostPanel> {
Future _onRepost() async {
dynamic result = await MsgHttp.createDynamic(
mid: GStorage.userInfo.get('userInfoCache').mid,
mid: GStorage.userInfo.get('userInfoCache')?.mid,
dynIdStr: widget.item.idStr,
rawText: _ctr.text,
);

View File

@@ -232,7 +232,7 @@ class MorePanel extends StatelessWidget {
minLeadingWidth: 0,
),
if (item.modules.moduleAuthor.mid ==
GStorage.userInfo.get('userInfoCache').mid)
GStorage.userInfo.get('userInfoCache')?.mid)
ListTile(
onTap: () async {
Get.back();

View File

@@ -232,7 +232,7 @@ class MorePanel extends StatelessWidget {
minLeadingWidth: 0,
),
if (item.modules.moduleAuthor.mid ==
GStorage.userInfo.get('userInfoCache').mid)
GStorage.userInfo.get('userInfoCache')?.mid)
ListTile(
onTap: () async {
Get.back();

View File

@@ -71,6 +71,6 @@ class MediaController extends CommonController {
Future<LoadingState> customGetData() => UserHttp.userfavFolder(
pn: 1,
ps: 5,
mid: mid ?? GStorage.userInfo.get('userInfoCache').mid,
mid: mid ?? GStorage.userInfo.get('userInfoCache')?.mid,
);
}

View File

@@ -51,7 +51,8 @@ class ChatItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
bool isOwner = item.senderUid == GStorage.userInfo.get('userInfoCache').mid;
bool isOwner =
item.senderUid == GStorage.userInfo.get('userInfoCache')?.mid;
bool isPic = item.msgType == MsgType.pic.value; // 图片
bool isText = item.msgType == MsgType.text.value; // 文本