👽 The removal of external id

This commit is contained in:
2024-09-11 23:40:23 +08:00
parent bba38e6845
commit f3b2a2a0ac
12 changed files with 33 additions and 31 deletions

View File

@@ -204,9 +204,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
String? placeholder;
if (_channel?.type == 1) {
final otherside = _channel!.members!
.where((e) => e.account.externalId != _accountId)
.first;
final otherside =
_channel!.members!.where((e) => e.account.id != _accountId).first;
title = otherside.account.nick;
placeholder = 'messageInputPlaceholder'.trParams(
{'channel': '@${otherside.account.name}'},

View File

@@ -43,8 +43,7 @@ class _ChannelDetailScreenState extends State<ChannelDetailScreen> {
void checkOwner() async {
final AuthProvider auth = Get.find();
setState(() {
_isOwned =
auth.userProfile.value!['id'] == widget.channel.account.externalId;
_isOwned = auth.userProfile.value!['id'] == widget.channel.account.id;
});
}

View File

@@ -102,6 +102,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
try {
_signRecord = await _dailySign.signToday();
_dailySign.listLastRecord(30).then((value) {
setState(() => _signRecordHistory = value);
});
} catch (e) {
context.showErrorDialog(e);
}
@@ -201,20 +204,22 @@ class _DashboardScreenState extends State<DashboardScreen> {
icon: const Icon(Icons.local_fire_department),
onPressed: _signingDaily ? null : _signDaily,
)
: IconButton(
tooltip: 'dailySignHistoryAction'.tr,
icon: const Icon(Icons.history),
onPressed: () {
showDialog(
context: context,
useRootNavigator: true,
builder: (context) =>
DailySignHistoryChartDialog(
data: _signRecordHistory,
),
);
},
),
: (_signRecordHistory?.isEmpty ?? true)
? const SizedBox.shrink()
: IconButton(
tooltip: 'dailySignHistoryAction'.tr,
icon: const Icon(Icons.history),
onPressed: () {
showDialog(
context: context,
useRootNavigator: true,
builder: (context) =>
DailySignHistoryChartDialog(
data: _signRecordHistory,
),
);
},
),
),
),
],