重新构建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({
errorText,
errorLevel,
onImRegisterRequest
persist,
onImRegisterRequest,
onPersistenceChange
}) {
const [form, setForm] = react__WEBPACK_IMPORTED_MODULE_0___default().useState({
username: '',
@@ -6250,6 +6252,11 @@ function Register({
[key]: e.target.value
});
const usingPhone = !!form.phone;
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
if (!persist) {
onPersistenceChange(true);
}
}, []);
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
if (errorLevel === 'err' && errorText) setSubmitting(false);
}, [errorText, errorLevel]);
@@ -6892,7 +6899,9 @@ function AuthOnboardingView({
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxDEV)(Register, {
errorText: errorText,
errorLevel: errorLevel,
onImRegisterRequest: onImRegisterRequest
persist: persist,
onImRegisterRequest: onImRegisterRequest,
onPersistenceChange: onPersistenceChange
}, void 0, false);
case 'reset':
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);
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) {
if (item && (item.ent || item.fmt || item.txt !== undefined)) {
return firstAttachment({
@@ -9150,6 +9163,7 @@ function LinkText({
}
function MediaThumb({
url,
poster,
video,
duration,
onOpen,
@@ -9165,20 +9179,21 @@ function MediaThumb({
}, void 0, false)]
}, void 0, true);
}
const imgSrc = video ? poster : url;
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("button", {
type: "button",
className: "library-media-thumb",
onClick: onOpen,
children: [url ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("img", {
src: url,
children: [imgSrc ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("img", {
src: imgSrc,
alt: video ? '视频缩略图' : '图片缩略图'
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Icon, {
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, {
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Icon, {
children: "play_circle"
}, void 0, false), duration ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("small", {
children: (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_4__.secondsToTime)(duration)
}, 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 / 1000)
}, void 0, false) : null]
}, void 0, true) : null]
}, void 0, true);
@@ -9223,6 +9238,7 @@ function FavoriteItem({
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, {
url: item._thumbUrl,
poster: item.type === 'video' ? videoPosterUrl(att) : null,
video: item.type === 'video',
duration: att && att.duration,
onOpen: onOpen,
@@ -9924,13 +9940,17 @@ function History({
}, item.seq, true))
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)("section", {
className: "library-media-grid",
children: list.map(item => (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(MediaThumb, {
url: mediaUrls[item.seq],
video: view === 'history-videos',
duration: item.duration,
onOpen: () => jump(item.seq),
removed: item.availability === 'removed'
}, item.seq, false))
children: list.map(item => {
const videoAtt = view === 'history-videos' ? attachmentFromFlat(item) : null;
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(MediaThumb, {
url: mediaUrls[item.seq],
poster: videoAtt ? videoPosterUrl(videoAtt) : null,
video: view === 'history-videos',
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", {
type: "button",
className: "library-load-more",
@@ -17837,7 +17857,8 @@ const CTRL_ERROR_TEXT_CN = {
'authentication required': '请先登录',
'unknown authentication scheme': '登录方式不受支持,请刷新页面重试',
'policy violation': '当前操作不符合安全策略要求',
'permission denied': '没有权限执行此操作,请重新登录'
'permission denied': '没有权限执行此操作,请重新登录',
'internal error': '服务器繁忙,请稍后重试'
};
function translateCtrlError(err) {
const raw = err && err.message;
@@ -18909,7 +18930,8 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
this.handleLoginSuccessful(this);
}
}).catch(err => {
this.handleError(err.message, 'err');
const known = translateCtrlError(err);
this.handleError(known || err && err.message || '注册失败,请稍后重试', 'err');
});
}
handleImRegisterRequest(login_, password_, displayName, extra, cred_) {