清除缓存/清除聊天记录/注销账号确认弹层改为叠加显示,不再是整页路由跳转
这三个"确认"操作原来是独立的hash路由,点击后"设置"整个列表(含标题栏)连同Header一起卸载, 只剩ConfirmSheet的半透明蒙层盖在空白背景上——蒙层本来是设计成衬着被弹出的页面看的,但因为 底下真的没有渲染任何东西,视觉上跟跳转到一个新的空白页面没有区别。 改为SettingsList自己的本地state(sheet: null|'cache'|'history'|'delete'),确认层作为兄弟 节点叠加渲染,列表本身不卸载,不再经过hash导航——照抄group-management-view.jsx的OwnerSelect (选择新群主)已经在用的正确模式。同时清理了tinode-web.jsx两处硬编码视图白名单里对应的 三个route名(不再是独立路由,无需保留)。 contact-management-view.jsx同类的删除好友/拉黑/清空聊天记录确认层核实过不受影响——它的 ConfirmSheet会重新渲染Settings页面作为背景,视觉上本来就是正确的。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
d759f67b11
commit
f688578714
+40
-27
@@ -14935,7 +14935,7 @@ const navigate = (view, params) => {
|
||||
});
|
||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_2__["default"].navigateTo(hash);
|
||||
};
|
||||
const PERSONAL_SETTINGS_VIEWS = ['personal-center', 'personal-profile', 'profile-nickname', 'profile-birth-date', 'profile-signature', 'profile-gender', 'profile-region', 'personal-qrcode', 'android-settings', 'cache-clear-confirm', 'clear-history-confirm', 'change-password', 'delete-account-confirm', 'app-version', 'privacy-settings', 'friend-discovery-settings', 'youth-mode-off', 'youth-mode-on', 'youth-mode-verify', 'notification-permission', 'permission-settings-reminder', 'camera-permission-info', 'microphone-permission-info'];
|
||||
const PERSONAL_SETTINGS_VIEWS = ['personal-center', 'personal-profile', 'profile-nickname', 'profile-birth-date', 'profile-signature', 'profile-gender', 'profile-region', 'personal-qrcode', 'android-settings', 'change-password', 'app-version', 'privacy-settings', 'friend-discovery-settings', 'youth-mode-off', 'youth-mode-on', 'youth-mode-verify', 'notification-permission', 'permission-settings-reminder', 'camera-permission-info', 'microphone-permission-info'];
|
||||
function Icon({
|
||||
children
|
||||
}) {
|
||||
@@ -15499,10 +15499,14 @@ function PersonalQr({
|
||||
}
|
||||
function SettingsList({
|
||||
onToast,
|
||||
onLogout
|
||||
onLogout,
|
||||
tinode,
|
||||
chatList,
|
||||
onDeleteAccount
|
||||
}) {
|
||||
const [youthSettings, setYouthSettings] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(() => (0,_lib_use_cached_data_js__WEBPACK_IMPORTED_MODULE_3__.readCachedData)('youth-mode') || null);
|
||||
const [realname, setRealname] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(() => (0,_lib_use_cached_data_js__WEBPACK_IMPORTED_MODULE_3__.readCachedData)('me-realname') || null);
|
||||
const [sheet, setSheet] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(null);
|
||||
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
||||
(0,_lib_im_api_js__WEBPACK_IMPORTED_MODULE_6__.getYouthMode)().then(d => {
|
||||
(0,_lib_use_cached_data_js__WEBPACK_IMPORTED_MODULE_3__.writeCachedData)('youth-mode', d);
|
||||
@@ -15535,11 +15539,11 @@ function SettingsList({
|
||||
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(MenuRow, {
|
||||
icon: "delete_sweep",
|
||||
title: "清除缓存",
|
||||
route: "cache-clear-confirm"
|
||||
onClick: () => setSheet('cache')
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(MenuRow, {
|
||||
icon: "mark_chat_read",
|
||||
title: "清除所有聊天记录",
|
||||
route: "clear-history-confirm"
|
||||
onClick: () => setSheet('history')
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(MenuRow, {
|
||||
icon: "password",
|
||||
title: "修改密码",
|
||||
@@ -15573,7 +15577,7 @@ function SettingsList({
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(MenuRow, {
|
||||
icon: "no_accounts",
|
||||
title: "注销账号",
|
||||
route: "delete-account-confirm",
|
||||
onClick: () => setSheet('delete'),
|
||||
danger: true
|
||||
}, void 0, false)
|
||||
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("button", {
|
||||
@@ -15582,7 +15586,19 @@ function SettingsList({
|
||||
onClick: logout,
|
||||
children: "退出当前登录"
|
||||
}, void 0, false)]
|
||||
}, void 0, true)]
|
||||
}, void 0, true), sheet === 'cache' ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(CacheClear, {
|
||||
onToast: onToast,
|
||||
onClose: () => setSheet(null)
|
||||
}, void 0, false) : null, sheet === 'history' ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(ClearHistoryConfirm, {
|
||||
onToast: onToast,
|
||||
tinode: tinode,
|
||||
chatList: chatList,
|
||||
onClose: () => setSheet(null)
|
||||
}, void 0, false) : null, sheet === 'delete' ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(DeleteAccountConfirm, {
|
||||
onToast: onToast,
|
||||
onDeleteAccount: onDeleteAccount,
|
||||
onClose: () => setSheet(null)
|
||||
}, void 0, false) : null]
|
||||
}, void 0, true);
|
||||
}
|
||||
function ConfirmSheet({
|
||||
@@ -15624,7 +15640,8 @@ function ConfirmSheet({
|
||||
}, void 0, false);
|
||||
}
|
||||
function CacheClear({
|
||||
onToast
|
||||
onToast,
|
||||
onClose
|
||||
}) {
|
||||
const [busy, setBusy] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(false);
|
||||
const [done, setDone] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(false);
|
||||
@@ -15659,20 +15676,21 @@ function CacheClear({
|
||||
confirmLabel: done ? '完成' : '确定',
|
||||
confirmDanger: !done,
|
||||
busy: busy,
|
||||
onConfirm: done ? () => navigate('android-settings') : confirm,
|
||||
onCancel: () => navigate('android-settings')
|
||||
onConfirm: done ? onClose : confirm,
|
||||
onCancel: onClose
|
||||
}, void 0, false);
|
||||
}
|
||||
function ClearHistoryConfirm({
|
||||
tinode,
|
||||
chatList,
|
||||
onToast
|
||||
onToast,
|
||||
onClose
|
||||
}) {
|
||||
const [busy, setBusy] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(false);
|
||||
const confirm = () => {
|
||||
if (!tinode || !chatList || !chatList.length) {
|
||||
onToast('没有可清除的会话');
|
||||
navigate('android-settings');
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
setBusy(true);
|
||||
@@ -15681,7 +15699,7 @@ function ClearHistoryConfirm({
|
||||
return topic ? topic.delMessagesAll(false).catch(() => {}) : Promise.resolve();
|
||||
})).then(() => {
|
||||
onToast('聊天记录已清空');
|
||||
navigate('android-settings');
|
||||
onClose();
|
||||
}).finally(() => setBusy(false));
|
||||
};
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(ConfirmSheet, {
|
||||
@@ -15690,7 +15708,7 @@ function ClearHistoryConfirm({
|
||||
body: "确定清除所有聊天记录?此操作不可恢复,但不会影响好友/群聊关系和收藏内容。",
|
||||
busy: busy,
|
||||
onConfirm: confirm,
|
||||
onCancel: () => navigate('android-settings')
|
||||
onCancel: onClose
|
||||
}, void 0, false);
|
||||
}
|
||||
function ChangePassword({
|
||||
@@ -15767,7 +15785,8 @@ function ChangePassword({
|
||||
}
|
||||
function DeleteAccountConfirm({
|
||||
onDeleteAccount,
|
||||
onToast
|
||||
onToast,
|
||||
onClose
|
||||
}) {
|
||||
const [step, setStep] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(1);
|
||||
const [password, setPassword] = react__WEBPACK_IMPORTED_MODULE_0___default().useState('');
|
||||
@@ -15794,7 +15813,7 @@ function DeleteAccountConfirm({
|
||||
body: "注销后账号数据将被永久删除且无法恢复,包括聊天记录、好友关系和收藏内容。如果你是某些群的群主,这些群也将被永久解散,其他成员将无法继续使用。确定要继续吗?",
|
||||
confirmLabel: "继续",
|
||||
onConfirm: () => setStep(2),
|
||||
onCancel: () => navigate('android-settings')
|
||||
onCancel: onClose
|
||||
}, void 0, false);
|
||||
}
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(ConfirmSheet, {
|
||||
@@ -15803,7 +15822,7 @@ function DeleteAccountConfirm({
|
||||
body: "请输入登录密码以确认注销账号(该操作立即生效,不可撤销)。",
|
||||
busy: busy,
|
||||
onConfirm: proceed,
|
||||
onCancel: () => navigate('android-settings'),
|
||||
onCancel: onClose,
|
||||
children: (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)("input", {
|
||||
type: "password",
|
||||
autoFocus: true,
|
||||
@@ -16327,19 +16346,13 @@ function PersonalSettingsView({
|
||||
onToast: setToast
|
||||
}, void 0, false);else if (view === 'android-settings') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(SettingsList, {
|
||||
onToast: setToast,
|
||||
onLogout: onLogout
|
||||
}, void 0, false);else if (view === 'cache-clear-confirm') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(CacheClear, {
|
||||
onToast: setToast
|
||||
}, void 0, false);else if (view === 'clear-history-confirm') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(ClearHistoryConfirm, {
|
||||
onToast: setToast,
|
||||
onLogout: onLogout,
|
||||
tinode: tinode,
|
||||
chatList: chatList
|
||||
chatList: chatList,
|
||||
onDeleteAccount: onDeleteAccount
|
||||
}, void 0, false);else if (view === 'change-password') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(ChangePassword, {
|
||||
onToast: setToast,
|
||||
onUpdatePassword: onUpdatePassword
|
||||
}, void 0, false);else if (view === 'delete-account-confirm') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(DeleteAccountConfirm, {
|
||||
onToast: setToast,
|
||||
onDeleteAccount: onDeleteAccount
|
||||
}, void 0, false);else if (view === 'app-version') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(AppVersion, {
|
||||
onToast: setToast
|
||||
}, void 0, false);else if (view === 'privacy-settings') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxDEV)(PrivacySettings, {
|
||||
@@ -17771,7 +17784,7 @@ const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
||||
description: 'Placeholder for the country selector'
|
||||
}
|
||||
});
|
||||
const SIDE_PANEL_VIEWS = ['acc_general', 'archive', 'blocked', 'contacts', 'cred', 'crop', 'edit', 'general', 'newtpk', 'notif', 'register', 'reset', 'security', 'settings', 'support', 'wallpapers', 'tenant', 'login', 'enterprise-register', 'enterprise-feedback', 'identity-check', 'realname', 'realname-verified', 'realname-reminder', 'independent-password', 'messages-home', 'messages-offline', 'messages-menu', 'message-actions', 'system-messages', 'chat-inbound-request', 'chat-inbound-message', 'chat-outbound-request', 'chat-status', 'chat-friend', 'chat-media', 'chat-blocked', 'chat-deleted', 'chat-standard', 'chat-attachments', 'chat-mixed', 'chat-contact-card', 'compose-keyboard', 'mentions-select', 'mentions-complete', 'mentions-message', 'emoji-panel', 'emoji-message', 'voice-ready', 'voice-hold', 'voice-recording', 'media-uploading', 'media-gallery', 'media-retry', 'upload-file', 'file-message', 'message-multiselect', 'favorite-success', 'forward-select', 'forward-multiple', 'forward-individual', 'forward-bundle', 'address-book', 'friend-requests', 'add-friend', 'my-friend-qr', 'friend-qr', 'friend-search-result', 'friend-verification', 'friend-profile', 'group-member-profile', 'friend-settings', 'friend-settings-blocked', 'friend-delete-confirm', 'block-list', 'block-confirm', 'clear-chat-confirm', 'group-list', 'group-empty', 'group-invite', 'group-events', 'group-join-requests', 'group-new-request', 'group-announcement', 'group-summary', 'group-announcement-detail', 'group-settings', 'group-profile', 'group-avatar', 'group-nickname', 'group-description', 'group-my-nickname', 'group-members', 'group-role-message', 'group-qr', 'group-governance', 'group-admins', 'group-admin-add', 'group-admin-success', 'group-admin-partial', 'group-admin-removed', 'group-mute-add', 'group-muted', 'group-owner-select', 'group-owner-confirm', 'group-files', 'group-file-upload', 'favorites', 'favorites-mixed', 'favorites-files', 'favorites-text', 'favorites-voice', 'favorites-links', 'favorites-image', 'favorites-video', 'favorites-select', 'favorite-share', 'file-download', 'file-downloading', 'file-downloaded', 'history-search', 'history-files', 'history-links', 'history-images', 'history-videos', 'call-history', 'call-incoming', 'audio-call-ringing', 'audio-call-active', 'audio-call-muted', 'audio-call-speaker', 'video-call-ringing', 'video-call-camera-off', 'video-call-active', 'video-call-peer-camera-off', 'call-minimized', 'workbench', 'organization-directory', 'meeting-organizer', 'meeting-attendee', 'meeting-create', 'meeting-detail', 'daily-report-editor', 'daily-report-mine', 'daily-report-team', 'daily-report-detail', 'monthly-report-editor', 'monthly-report-mine', 'monthly-report-team', 'monthly-report-detail', 'executive-mailbox', 'executive-mailbox-notice', 'personal-center', 'personal-profile', 'profile-nickname', 'profile-birth-date', 'profile-signature', 'profile-gender', 'profile-region', 'personal-qrcode', 'android-settings', 'cache-clear-confirm', 'clear-history-confirm', 'change-password', 'delete-account-confirm', 'app-version', 'privacy-settings', 'friend-discovery-settings', 'youth-mode-off', 'youth-mode-on', 'youth-mode-verify', 'notification-permission', 'permission-settings-reminder', 'camera-permission-info', 'microphone-permission-info', 'fraud-risk-warning', 'fraud-risk-confirmation', 'abuse-report-reasons', 'abuse-report-details', 'user-feedback', ''];
|
||||
const SIDE_PANEL_VIEWS = ['acc_general', 'archive', 'blocked', 'contacts', 'cred', 'crop', 'edit', 'general', 'newtpk', 'notif', 'register', 'reset', 'security', 'settings', 'support', 'wallpapers', 'tenant', 'login', 'enterprise-register', 'enterprise-feedback', 'identity-check', 'realname', 'realname-verified', 'realname-reminder', 'independent-password', 'messages-home', 'messages-offline', 'messages-menu', 'message-actions', 'system-messages', 'chat-inbound-request', 'chat-inbound-message', 'chat-outbound-request', 'chat-status', 'chat-friend', 'chat-media', 'chat-blocked', 'chat-deleted', 'chat-standard', 'chat-attachments', 'chat-mixed', 'chat-contact-card', 'compose-keyboard', 'mentions-select', 'mentions-complete', 'mentions-message', 'emoji-panel', 'emoji-message', 'voice-ready', 'voice-hold', 'voice-recording', 'media-uploading', 'media-gallery', 'media-retry', 'upload-file', 'file-message', 'message-multiselect', 'favorite-success', 'forward-select', 'forward-multiple', 'forward-individual', 'forward-bundle', 'address-book', 'friend-requests', 'add-friend', 'my-friend-qr', 'friend-qr', 'friend-search-result', 'friend-verification', 'friend-profile', 'group-member-profile', 'friend-settings', 'friend-settings-blocked', 'friend-delete-confirm', 'block-list', 'block-confirm', 'clear-chat-confirm', 'group-list', 'group-empty', 'group-invite', 'group-events', 'group-join-requests', 'group-new-request', 'group-announcement', 'group-summary', 'group-announcement-detail', 'group-settings', 'group-profile', 'group-avatar', 'group-nickname', 'group-description', 'group-my-nickname', 'group-members', 'group-role-message', 'group-qr', 'group-governance', 'group-admins', 'group-admin-add', 'group-admin-success', 'group-admin-partial', 'group-admin-removed', 'group-mute-add', 'group-muted', 'group-owner-select', 'group-owner-confirm', 'group-files', 'group-file-upload', 'favorites', 'favorites-mixed', 'favorites-files', 'favorites-text', 'favorites-voice', 'favorites-links', 'favorites-image', 'favorites-video', 'favorites-select', 'favorite-share', 'file-download', 'file-downloading', 'file-downloaded', 'history-search', 'history-files', 'history-links', 'history-images', 'history-videos', 'call-history', 'call-incoming', 'audio-call-ringing', 'audio-call-active', 'audio-call-muted', 'audio-call-speaker', 'video-call-ringing', 'video-call-camera-off', 'video-call-active', 'video-call-peer-camera-off', 'call-minimized', 'workbench', 'organization-directory', 'meeting-organizer', 'meeting-attendee', 'meeting-create', 'meeting-detail', 'daily-report-editor', 'daily-report-mine', 'daily-report-team', 'daily-report-detail', 'monthly-report-editor', 'monthly-report-mine', 'monthly-report-team', 'monthly-report-detail', 'executive-mailbox', 'executive-mailbox-notice', 'personal-center', 'personal-profile', 'profile-nickname', 'profile-birth-date', 'profile-signature', 'profile-gender', 'profile-region', 'personal-qrcode', 'android-settings', 'change-password', 'app-version', 'privacy-settings', 'friend-discovery-settings', 'youth-mode-off', 'youth-mode-on', 'youth-mode-verify', 'notification-permission', 'permission-settings-reminder', 'camera-permission-info', 'microphone-permission-info', 'fraud-risk-warning', 'fraud-risk-confirmation', 'abuse-report-reasons', 'abuse-report-details', 'user-feedback', ''];
|
||||
const AUTH_FLOW_VIEWS = ['tenant', 'login', 'register', 'reset', 'cred', 'enterprise-register', 'enterprise-feedback'];
|
||||
const CTRL_ERROR_TEXT_CN = {
|
||||
'authentication failed': '账号或密码错误',
|
||||
@@ -19879,7 +19892,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
const chapterSevenActive = ['favorites', 'favorites-mixed', 'favorites-files', 'favorites-text', 'favorites-voice', 'favorites-links', 'favorites-image', 'favorites-video', 'favorites-select', 'favorite-share', 'file-download', 'file-downloading', 'file-downloaded', 'history-search', 'history-files', 'history-links', 'history-images', 'history-videos'].includes(activeProductView);
|
||||
const callExperienceActive = ['call-history', 'call-incoming', 'audio-call-ringing', 'audio-call-active', 'audio-call-muted', 'audio-call-speaker', 'video-call-ringing', 'video-call-camera-off', 'video-call-active', 'video-call-peer-camera-off', 'call-minimized'].includes(activeProductView);
|
||||
const workplaceCollaborationActive = ['workbench', 'organization-directory', 'meeting-organizer', 'meeting-attendee', 'meeting-create', 'meeting-detail', 'daily-report-editor', 'daily-report-mine', 'daily-report-team', 'daily-report-detail', 'monthly-report-editor', 'monthly-report-mine', 'monthly-report-team', 'monthly-report-detail', 'executive-mailbox', 'executive-mailbox-notice'].includes(activeProductView);
|
||||
const personalSettingsActive = ['personal-center', 'personal-profile', 'profile-nickname', 'profile-birth-date', 'profile-signature', 'profile-gender', 'profile-region', 'personal-qrcode', 'android-settings', 'cache-clear-confirm', 'clear-history-confirm', 'change-password', 'delete-account-confirm', 'app-version', 'privacy-settings', 'friend-discovery-settings', 'youth-mode-off', 'youth-mode-on', 'youth-mode-verify', 'notification-permission', 'permission-settings-reminder', 'camera-permission-info', 'microphone-permission-info'].includes(activeProductView);
|
||||
const personalSettingsActive = ['personal-center', 'personal-profile', 'profile-nickname', 'profile-birth-date', 'profile-signature', 'profile-gender', 'profile-region', 'personal-qrcode', 'android-settings', 'change-password', 'app-version', 'privacy-settings', 'friend-discovery-settings', 'youth-mode-off', 'youth-mode-on', 'youth-mode-verify', 'notification-permission', 'permission-settings-reminder', 'camera-permission-info', 'microphone-permission-info'].includes(activeProductView);
|
||||
const securitySupportActive = ['fraud-risk-warning', 'fraud-risk-confirmation', 'abuse-report-reasons', 'abuse-report-details', 'user-feedback'].includes(activeProductView);
|
||||
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_23__.jsxDEV)("div", {
|
||||
id: "app-container",
|
||||
|
||||
Reference in New Issue
Block a user