From fa2da81eb634aefd1abad561533b3ab36eb8d1cf Mon Sep 17 00:00:00 2001 From: Jamie Hu Date: Wed, 27 Sep 2023 10:45:50 +0800 Subject: [PATCH] fix: fix merge --- lib/controller/chat_message_controller.dart | 1 + lib/util/functions.dart | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/controller/chat_message_controller.dart b/lib/controller/chat_message_controller.dart index 336d8d7..3b599fb 100644 --- a/lib/controller/chat_message_controller.dart +++ b/lib/controller/chat_message_controller.dart @@ -248,6 +248,7 @@ class ChatMessageController extends GetxController { onDone: () { logger.d("done ------------------- "); saveMessage(input); + targetMessage.updated = getCurrentDateTime(); // Update lastupdated saveMessage(targetMessage); if (targetMessage.generating == true) { targetMessage.closeStream(); diff --git a/lib/util/functions.dart b/lib/util/functions.dart index 934aed5..dba3141 100644 --- a/lib/util/functions.dart +++ b/lib/util/functions.dart @@ -8,6 +8,7 @@ import 'package:flutter_tiktoken/flutter_tiktoken.dart'; import 'package:geek_chat/service/http_service.dart'; import 'package:get/get.dart'; import 'package:logger/logger.dart'; +import 'package:moment_dart/moment_dart.dart'; enum DeviceType { small, wide } @@ -64,3 +65,7 @@ int convertVersionToNumber(String version) { versionCells = versionCells.map((i) => int.parse(i)).toList(); return versionCells[0] * 100000 + versionCells[1] * 1000 + versionCells[2]; } + +int getCurrentDateTime() { + return int.parse(Moment.now().format('YYYYMMDDHHmmssSSS').toString()); +}