Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 新版消息结构、新增消息撤回功能等 #50

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

oljc
Copy link
Contributor

@oljc oljc commented Jun 9, 2023

🤔 这个变动的性质是? (至少选中一项)

  • 日常 bug 修复
  • 新特性提交
  • 组件样式/交互改进
  • 重构
  • 代码风格优化
  • 包体积优化
  • 性能优化
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • 变更为新版消息结构体(影响范围:与之前消息相关的类型定义文件)
  • 新增消息撤回、删除、管理员拉黑
  • 优化sendMsgHandler函数里针对中文输入法回车处理的实现方式
  • 调整消息操作的UI交互效果(移动端交互不同,下个PR提交)
  • ....
语言 更新描述
🇺🇸 英文 Implement message retraction feature
🇨🇳 中文 新增消息撤回功能

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • [x ] 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

🚀 概述

-copilot:walkthrough

🔍 实现细节

copilot:walkthrough

Copy link
Owner

@Evansy Evansy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢 RP~

const userInfo = useUserStore()?.userInfo
const chatStore = useChatStore()
const isCurrentUser = computed(() => props.msg?.fromUser.uid === userInfo.uid)
const isAdmin = computed(() => userInfo?.power === PowerType.Admin)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以尝试封装为hook和指令,方便复用,这里指令比较合适

@@ -60,7 +75,11 @@ export const useChatStore = defineStore('chat', () => {
// 过滤掉小黑子的发言
const filterUser = (uid: number) => {
if (typeof uid !== 'number') return
chatMessageList.value = chatMessageList.value.filter((item) => item.fromUser.uid !== uid)
messageMap.forEach((msg) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大列表循环while和for效率会高一点点

@Evansy Evansy merged commit 5a8a6dd into Evansy:main Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants