重新构建dev产物(清理调试残留日志+本轮3处修复的编译产物)

This commit is contained in:
Your Name
2026-09-06 15:04:00 +08:00
parent 4715ea4497
commit cd092108c2
6 changed files with 118 additions and 28 deletions
+32 -10
View File
@@ -9334,12 +9334,13 @@ const TYPE_ROUTE = {
const TYPE_LABELS = [['all', '全部'], ['image', '图片'], ['video', '视频'], ['file', '文件'], ['voice', '语音'], ['text', '文本'], ['link', '链接']];
function Favorites({
view,
hashParams,
tinode,
onToast
}) {
const initialType = view === 'favorites-files' ? 'file' : view === 'favorites-text' ? 'text' : view === 'favorites-voice' ? 'voice' : view === 'favorites-links' ? 'link' : view === 'favorites-image' ? 'image' : view === 'favorites-video' ? 'video' : 'all';
const selecting = view === 'favorites-select';
const [type, setType] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(selecting ? 'file' : initialType);
const [type, setType] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(selecting ? hashParams && hashParams.type || 'file' : initialType);
const [queryInput, setQueryInput] = react__WEBPACK_IMPORTED_MODULE_0___default().useState('');
const query = (0,_lib_use_cached_data_js__WEBPACK_IMPORTED_MODULE_6__.useDebouncedValue)(queryInput, 300);
const [selected, setSelected] = react__WEBPACK_IMPORTED_MODULE_0___default().useState([]);
@@ -9432,9 +9433,11 @@ function Favorites({
className: "library-page",
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Header, {
title: selecting ? `已选择 ${selected.length} 项` : '我的收藏',
back: selecting ? 'favorites-files' : 'messages-home',
back: selecting ? TYPE_ROUTE[type] || 'favorites-files' : 'messages-home',
right: selecting ? '取消' : '多选',
onRight: () => navigate(selecting ? 'favorites-files' : 'favorites-select')
onRight: () => navigate(selecting ? TYPE_ROUTE[type] || 'favorites-files' : 'favorites-select', selecting ? undefined : {
type
})
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Search, {
value: queryInput,
onChange: setQueryInput,
@@ -9446,6 +9449,7 @@ function Favorites({
className: type === id ? 'active' : '',
onClick: () => {
setType(id);
setSelected([]);
if (TYPE_ROUTE[id] && !selecting) navigateReplace(TYPE_ROUTE[id]);
},
children: label
@@ -9535,7 +9539,7 @@ function FavoriteShare({
return forTarget.length > 0 && forTarget.every(r => r.status === 'sent');
}).length;
onToast(successTargets === selected.length ? `已分享给 ${selected.length} 个会话` : `${successTargets}/${selected.length} 个会话分享成功`);
window.setTimeout(() => navigate('favorites-files'), 700);
window.setTimeout(() => navigate(TYPE_ROUTE[preview && preview.type] || 'favorites-files'), 700);
}).catch(err => onToast(err.message || '分享失败')).finally(() => setSending(false));
};
const previewAtt = preview && firstAttachment(preview.snapshot && preview.snapshot.content);
@@ -9548,7 +9552,10 @@ function FavoriteShare({
className: "library-page",
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Header, {
title: "分享",
back: "favorites-select"
back: "favorites-select",
backParams: preview ? {
type: preview.type
} : undefined
}, void 0, false), !confirming ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Search, {
value: query,
@@ -10043,6 +10050,7 @@ function ContentLibraryView({
let content;
if (view.startsWith('favorites')) content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Favorites, {
view: view,
hashParams: hashParams,
tinode: tinode,
onToast: setToast
}, void 0, false);else if (view === 'favorite-share') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(FavoriteShare, {
@@ -12609,6 +12617,14 @@ const FILE_TYPE_META = {
document: ['description', '#e05d44'],
file: ['insert_drive_file', '#8a8f98']
};
const DOCUMENT_EXT = ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt'];
function fileTypeFromMime(mime, name) {
const prefix = (mime || '').split('/')[0];
if (prefix === 'image' || prefix === 'video' || prefix === 'audio') return prefix;
const ext = (/\.([a-zA-Z0-9]+)$/.exec(name || '') || [])[1];
if (mime === 'application/pdf' || DOCUMENT_EXT.includes((ext || '').toLowerCase())) return 'document';
return 'file';
}
function GroupFiles({
topic,
tinode,
@@ -12678,7 +12694,8 @@ function GroupFiles({
fileId,
fileName: file.name,
mimeType: file.type,
fileSize: file.size
fileSize: file.size,
fileType: fileTypeFromMime(file.type, file.name)
})).then(() => {
setUploading(null);
load();
@@ -13769,6 +13786,7 @@ function MessageActions() {
const NOTIFICATION_TEXT = {
'group.created': '你创建了一个新群聊',
'group.join_request.created': '有人申请加入你管理的群聊',
'group.announcement.updated': '群公告有更新',
'group.member.joined': '有成员加入了群聊',
'group.member.left': '有成员退出了群聊',
'group.member.updated': '群成员资料有更新',
@@ -18448,7 +18466,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
}
let topicName = hash.path[1] || null;
if (topicName != this.state.topicSelected) {
if (!tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.topicType(topicName)) {
if (!tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.topicType(topicName) || !this.tinode.isAuthenticated()) {
topicName = null;
newState.mobilePanel = 'sidepanel';
} else {
@@ -20866,16 +20884,18 @@ function ImgFromFile({
}
const LEVEL_NUMERALS = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
const levelLabel = n => LEVEL_NUMERALS[n - 1] || String(n);
const isMyUserId = (id, myUserId) => id === myUserId || 'usr' + id === myUserId;
function DeptRow({
dept,
depth,
expanded,
containsMe,
onToggle
}) {
const icon = depth === 0 ? 'business' : 'diamond';
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("button", {
type: "button",
className: `organization-department depth-${depth}${expanded ? ' expanded' : ''}`,
className: `organization-department depth-${depth}${containsMe ? ' me' : ''}`,
style: {
paddingLeft: `${1 + depth * 1.1}rem`
},
@@ -20961,11 +20981,13 @@ function DeptNode({
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
if (expanded) load();
}, []);
const containsMe = (members || []).some(p => isMyUserId(p.user_id, myUserId));
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(DeptRow, {
dept: dept,
depth: depth,
expanded: expanded,
containsMe: containsMe,
onToggle: toggle
}, void 0, false), expanded && loading ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("p", {
className: "organization-loading",
@@ -20989,7 +21011,7 @@ function DeptNode({
person: person,
depth: depth + 1,
level: depth + 2,
isMe: person.user_id === myUserId || 'usr' + person.user_id === myUserId
isMe: isMyUserId(person.user_id, myUserId)
}, person.user_id, false))]
}, void 0, true) : null]
}, void 0, true);
@@ -21560,7 +21582,7 @@ function OrganizationDirectory({
person: item.user,
depth: 0,
level: 3,
isMe: item.user && (item.user.user_id === myUserId || 'usr' + item.user.user_id === myUserId)
isMe: !!(item.user && isMyUserId(item.user.user_id, myUserId))
}, 'u' + (item.user && item.user.user_id || idx), false))
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("section", {
className: "organization-tree",