feat: add email sending functionality and improve user feedback

- Added translation for "Send email" and "Email copied to clipboard" in Chinese.
- Implemented email copy to clipboard feature in AboutDialog component.
- Enhanced navigation logic in Header component to check mode before redirecting.
- Updated state mapping in Header container to include mode.
- Removed unused imports in AccountSetting component.
- Simplified download logic in Viewer component to improve error handling.
This commit is contained in:
troyeguo
2025-11-27 17:13:08 +08:00
parent 877fdc127a
commit e84415374e
9 changed files with 23 additions and 14 deletions

View File

File diff suppressed because one or more lines are too long

View File

@@ -338,6 +338,8 @@
"Download successful": "下载成功",
"Download failed": "下载失败",
"Downloading": "下载中",
"Send email": "发送邮件",
"Email copied to clipboard": "邮箱已复制到剪贴板",
"Back": "返回",
"Almost finished": "即将完成",
"Please select an empty folder": "请选择一个空文件夹",

View File

@@ -13,8 +13,7 @@ import {
import "./aboutDialog.css";
import DatabaseService from "../../../utils/storage/databaseService";
import { ConfigService } from "../../../assets/lib/kookit-extra-browser.min";
import ConfigUtil from "../../../utils/file/configUtil";
import copyTextToClipboard from "copy-text-to-clipboard";
declare var window: any;
class AboutDialog extends React.Component<AboutDialogProps, AboutDialogState> {
constructor(props: AboutDialogProps) {
@@ -90,6 +89,15 @@ class AboutDialog extends React.Component<AboutDialogProps, AboutDialogState> {
>
<Trans>Our website</Trans>
</li>
<li
className="sort-by-category-list"
onClick={() => {
copyTextToClipboard("feedback@koodoreader.com");
toast.success(this.props.t("Email copied to clipboard"));
}}
>
<Trans>Send email</Trans>
</li>
<li
className="sort-by-category-list"
onClick={() => {

View File

@@ -63,6 +63,7 @@ class PopupRefer extends React.Component<PopupReferProps, PopupReferStates> {
handleLinkJump = async (event: any): Promise<boolean> => {
let href = this.props.rendition.getTargetHref(event);
let result = await this.props.rendition.handleLinkJump(href, event);
console.log(result, "we3463454");
if (!result.handled) {
return false;
}

View File

@@ -31,7 +31,6 @@ import {
checkMissingBook,
generateSyncRecord,
getChatLocale,
getStorageLocation,
getWebsiteUrl,
removeChatBox,
showTaskProgress,
@@ -191,7 +190,9 @@ class Header extends React.Component<HeaderProps, HeaderState> {
};
handleFinishUpgrade = () => {
setTimeout(() => {
this.props.history.push("/manager/home");
if (this.props.mode === "home") {
this.props.history.push("/manager/home");
}
}, 2000);
};
@@ -424,7 +425,9 @@ class Header extends React.Component<HeaderProps, HeaderState> {
}
//when book is empty, need to refresh the book list
setTimeout(() => {
this.props.history.push("/manager/home");
if (this.props.mode === "home") {
this.props.history.push("/manager/home");
}
}, 1000);
};
handleSync = async (compareResult) => {

View File

@@ -30,6 +30,7 @@ const mapStateToProps = (state: stateType) => {
isCollapsed: state.sidebar.isCollapsed,
isNewWarning: state.manager.isNewWarning,
notes: state.reader.notes,
mode: state.sidebar.mode,
isAuthed: state.manager.isAuthed,
defaultSyncOption: state.backupPage.defaultSyncOption,
userInfo: state.manager.userInfo,

View File

@@ -14,6 +14,7 @@ export interface HeaderProps extends RouteComponentProps<any> {
notes: NoteModel[];
books: BookModel[];
defaultSyncOption: string;
mode: string;
userInfo: any;
bookSortCode: { sort: number; order: number };
handleSortDisplay: (isSortDisplay: boolean) => void;

View File

@@ -3,7 +3,6 @@ import { SettingInfoProps, SettingInfoState } from "./interface";
import { Trans } from "react-i18next";
import { isElectron } from "react-device-detect";
import _ from "underscore";
import { themeList } from "../../../constants/themeList";
import toast from "react-hot-toast";
import {
formatTimestamp,

View File

@@ -215,13 +215,7 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
if (result) {
toast.success(this.props.t("Download successful"));
} else {
result = await BookUtil.downloadCacheBook(key);
if (result) {
toast.success(this.props.t("Download successful"));
} else {
toast.error(this.props.t("Download failed"));
return;
}
toast.error(this.props.t("Book not exists"));
}
} else {
toast.error(this.props.t("Book not exists"));