Skip to content

Commit bc9777d

Browse files
committed
Merge branch 'pr/SlotSun/839' into dev
2 parents 060cde3 + c979d08 commit bc9777d

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

simple_live_app/lib/modules/follow_user/follow_user_controller.dart

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class FollowUserController extends BasePageController<FollowUser> {
131131
filterData();
132132
}
133133

134-
void removeTag(FollowUserTag tag) {
134+
Future<void> removeTag(FollowUserTag tag) async {
135135
// 将tag下的所有follow设置为全部
136136
for(var i in tag.userId){
137137
var follow = DBService.instance.followBox.get(i);
@@ -140,7 +140,7 @@ class FollowUserController extends BasePageController<FollowUser> {
140140
updateItem(follow);
141141
}
142142
}
143-
FollowService.instance.delFollowUserTag(tag);
143+
await FollowService.instance.delFollowUserTag(tag);
144144
updateTagList();
145145
Log.i('删除tag${tag.tag}');
146146
}
@@ -158,19 +158,27 @@ class FollowUserController extends BasePageController<FollowUser> {
158158
FollowService.instance.updateFollowUserTag(followUserTag);
159159
}
160160

161-
void updateTagName(FollowUserTag followUserTag, String tag) {
161+
void updateTagName(FollowUserTag followUserTag, String newTagName) {
162162
// 未操作
163-
if (followUserTag.tag == tag) {
163+
if (followUserTag.tag == newTagName) {
164164
return;
165165
}
166166
// 避免重名
167-
if (tagList.any((item) => item.tag == tag)) {
167+
if (tagList.any((item) => item.tag == newTagName)) {
168168
SmartDialog.showToast("标签名重复,修改失败");
169169
return;
170170
}
171-
final FollowUserTag item = followUserTag.copyWith(tag: tag);
172-
updateTag(item);
173-
SmartDialog.showToast("修改成功");
171+
final FollowUserTag newTag = followUserTag.copyWith(tag: newTagName);
172+
updateTag(newTag);
173+
// update item's tag when update tagName
174+
for(var i in newTag.userId){
175+
var follow = DBService.instance.followBox.get(i);
176+
if(follow != null){
177+
follow.tag = newTagName;
178+
updateItem(follow);
179+
}
180+
}
181+
SmartDialog.showToast("标签名修改成功");
174182
updateTagList();
175183
}
176184

simple_live_app/lib/modules/follow_user/follow_user_page.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ class FollowUserPage extends GetView<FollowUserController> {
211211
IconButton(
212212
icon: const Icon(
213213
Icons.check,
214-
color: Colors.black,
215214
),
216215
onPressed: () {
217216
controller.setItemTag(item, checkTag.value);

simple_live_app/lib/modules/live_room/live_room_controller.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ class LiveRoomController extends PlayerController with WidgetsBindingObserver {
317317
getSuperChatMessage();
318318

319319
addHistory();
320+
// 确认房间关注状态
321+
followed.value = DBService.instance.getFollowExist("${site.id}_$roomId");
320322
online.value = detail.value!.online;
321323
liveStatus.value = detail.value!.status || detail.value!.isRecord;
322324
if (liveStatus.value) {

simple_live_app/lib/modules/sync/remote_sync/webdav/remote_sync_webdav_controller.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ class RemoteSyncWebDAVController extends BaseController {
261261
var user = FollowUser.fromJson(item);
262262
await DBService.instance.followBox.put(user.id, user);
263263
}
264-
EventBus.instance.emit(Constant.kUpdateFollow, 0);
265264
Log.i('已同步关注用户列表');
266265
} catch (e) {
267266
Log.e('同步关注用户列表失败: $e', StackTrace.current);

simple_live_app/lib/services/follow_service.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ class FollowService extends GetxService {
6868
}
6969

7070
// 删除标签
71-
void delFollowUserTag(FollowUserTag tag) {
71+
Future<void> delFollowUserTag(FollowUserTag tag) async {
7272
followTagList.remove(tag);
73-
DBService.instance.deleteFollowTag(tag.id);
73+
await DBService.instance.deleteFollowTag(tag.id);
7474
}
7575

7676
// 获取用户自定义标签列表

0 commit comments

Comments
 (0)