重新构建dev产物(注册持久化登录、白屏崩溃、视频缩略图三处修复)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Your Name
2026-09-06 00:49:13 +08:00
co-authored by Claude Sonnet 5
parent bab1f13e04
commit 4dbe76f2bd
4 changed files with 43 additions and 19 deletions
+37 -15
View File
@@ -6232,7 +6232,9 @@ function VerificationButton({
function Register({ function Register({
errorText, errorText,
errorLevel, errorLevel,
onImRegisterRequest persist,
onImRegisterRequest,
onPersistenceChange
}) { }) {
const [form, setForm] = react__WEBPACK_IMPORTED_MODULE_0___default().useState({ const [form, setForm] = react__WEBPACK_IMPORTED_MODULE_0___default().useState({
username: '', username: '',
@@ -6250,6 +6252,11 @@ function Register({
[key]: e.target.value [key]: e.target.value
}); });
const usingPhone = !!form.phone; const usingPhone = !!form.phone;
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
if (!persist) {
onPersistenceChange(true);
}
}, []);
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => { react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
if (errorLevel === 'err' && errorText) setSubmitting(false); if (errorLevel === 'err' && errorText) setSubmitting(false);
}, [errorText, errorLevel]); }, [errorText, errorLevel]);
@@ -6892,7 +6899,9 @@ function AuthOnboardingView({
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(Register, { return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(Register, {
errorText: errorText, errorText: errorText,
errorLevel: errorLevel, errorLevel: errorLevel,
onImRegisterRequest: onImRegisterRequest persist: persist,
onImRegisterRequest: onImRegisterRequest,
onPersistenceChange: onPersistenceChange
}, void 0, false); }, void 0, false);
case 'reset': case 'reset':
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(PasswordReset, {}, void 0, false); return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(PasswordReset, {}, void 0, false);
@@ -9023,6 +9032,10 @@ function resolveAttachmentUrl(att) {
if (direct.startsWith('blob:') || direct.startsWith('data:')) return Promise.resolve(direct); if (direct.startsWith('blob:') || direct.startsWith('data:')) return Promise.resolve(direct);
return (0,_lib_im_api_js__WEBPACK_IMPORTED_MODULE_5__.getFileUrl)(direct.slice(direct.lastIndexOf('/') + 1)).catch(() => null); return (0,_lib_im_api_js__WEBPACK_IMPORTED_MODULE_5__.getFileUrl)(direct.slice(direct.lastIndexOf('/') + 1)).catch(() => null);
} }
function videoPosterUrl(att) {
if (!att || !att.preview) return null;
return 'data:' + (att.premime || 'image/jpeg') + ';base64,' + att.preview;
}
function attachmentFromFlat(item) { function attachmentFromFlat(item) {
if (item && (item.ent || item.fmt || item.txt !== undefined)) { if (item && (item.ent || item.fmt || item.txt !== undefined)) {
return firstAttachment({ return firstAttachment({
@@ -9150,6 +9163,7 @@ function LinkText({
} }
function MediaThumb({ function MediaThumb({
url, url,
poster,
video, video,
duration, duration,
onOpen, onOpen,
@@ -9165,20 +9179,21 @@ function MediaThumb({
}, void 0, false)] }, void 0, false)]
}, void 0, true); }, void 0, true);
} }
const imgSrc = video ? poster : url;
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("button", { return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("button", {
type: "button", type: "button",
className: "library-media-thumb", className: "library-media-thumb",
onClick: onOpen, onClick: onOpen,
children: [url ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("img", { children: [imgSrc ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("img", {
src: url, src: imgSrc,
alt: video ? '视频缩略图' : '图片缩略图' alt: video ? '视频缩略图' : '图片缩略图'
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Icon, { }, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Icon, {
children: video ? 'videocam' : 'image' children: video ? 'videocam' : 'image'
}, void 0, false), video ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, { }, void 0, false), video ? (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)(Icon, { children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Icon, {
children: "play_circle" children: "play_circle"
}, void 0, false), duration ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("small", { }, void 0, false), duration > 0 ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("small", {
children: (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_4__.secondsToTime)(duration) children: (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_4__.secondsToTime)(duration / 1000)
}, void 0, false) : null] }, void 0, false) : null]
}, void 0, true) : null] }, void 0, true) : null]
}, void 0, true); }, void 0, true);
@@ -9223,6 +9238,7 @@ function FavoriteItem({
removed: item.availability === 'removed' removed: item.availability === 'removed'
}, void 0, false) : null, item.type === 'image' || item.type === 'video' ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(MediaThumb, { }, void 0, false) : null, item.type === 'image' || item.type === 'video' ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(MediaThumb, {
url: item._thumbUrl, url: item._thumbUrl,
poster: item.type === 'video' ? videoPosterUrl(att) : null,
video: item.type === 'video', video: item.type === 'video',
duration: att && att.duration, duration: att && att.duration,
onOpen: onOpen, onOpen: onOpen,
@@ -9924,13 +9940,17 @@ function History({
}, item.seq, true)) }, item.seq, true))
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("section", { }, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("section", {
className: "library-media-grid", className: "library-media-grid",
children: list.map(item => (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(MediaThumb, { children: list.map(item => {
url: mediaUrls[item.seq], const videoAtt = view === 'history-videos' ? attachmentFromFlat(item) : null;
video: view === 'history-videos', return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(MediaThumb, {
duration: item.duration, url: mediaUrls[item.seq],
onOpen: () => jump(item.seq), poster: videoAtt ? videoPosterUrl(videoAtt) : null,
removed: item.availability === 'removed' video: view === 'history-videos',
}, item.seq, false)) duration: videoAtt && videoAtt.duration,
onOpen: () => jump(item.seq),
removed: item.availability === 'removed'
}, item.seq, false);
})
}, void 0, false), hasMore ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("button", { }, void 0, false), hasMore ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("button", {
type: "button", type: "button",
className: "library-load-more", className: "library-load-more",
@@ -17837,7 +17857,8 @@ const CTRL_ERROR_TEXT_CN = {
'authentication required': '请先登录', 'authentication required': '请先登录',
'unknown authentication scheme': '登录方式不受支持,请刷新页面重试', 'unknown authentication scheme': '登录方式不受支持,请刷新页面重试',
'policy violation': '当前操作不符合安全策略要求', 'policy violation': '当前操作不符合安全策略要求',
'permission denied': '没有权限执行此操作,请重新登录' 'permission denied': '没有权限执行此操作,请重新登录',
'internal error': '服务器繁忙,请稍后重试'
}; };
function translateCtrlError(err) { function translateCtrlError(err) {
const raw = err && err.message; const raw = err && err.message;
@@ -18909,7 +18930,8 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
this.handleLoginSuccessful(this); this.handleLoginSuccessful(this);
} }
}).catch(err => { }).catch(err => {
this.handleError(err.message, 'err'); const known = translateCtrlError(err);
this.handleError(known || err && err.message || '注册失败,请稍后重试', 'err');
}); });
} }
handleImRegisterRequest(login_, password_, displayName, extra, cred_) { handleImRegisterRequest(login_, password_, displayName, extra, cred_) {
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -2
View File
@@ -3670,8 +3670,10 @@ class SendMessage extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp
this.setState({ this.setState({
message: msg message: msg
}, _ => { }, _ => {
this.messageEditArea.scrollTop = this.messageEditArea.scrollHeight; if (this.messageEditArea) {
this.messageEditArea.setSelectionRange(msg.length, msg.length); this.messageEditArea.scrollTop = this.messageEditArea.scrollHeight;
this.messageEditArea.setSelectionRange(msg.length, msg.length);
}
}); });
} }
if (prevProps.reply != this.props.reply) { if (prevProps.reply != this.props.reply) {
File diff suppressed because one or more lines are too long