mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2025-12-23 23:17:55 -05:00
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:
2
src/assets/lib/kookit.min.js
vendored
2
src/assets/lib/kookit.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -338,6 +338,8 @@
|
||||
"Download successful": "下载成功",
|
||||
"Download failed": "下载失败",
|
||||
"Downloading": "下载中",
|
||||
"Send email": "发送邮件",
|
||||
"Email copied to clipboard": "邮箱已复制到剪贴板",
|
||||
"Back": "返回",
|
||||
"Almost finished": "即将完成",
|
||||
"Please select an empty folder": "请选择一个空文件夹",
|
||||
|
||||
@@ -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={() => {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user