Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
troyeguo committed Sep 10, 2023
1 parent 5a619ba commit 4fa3ed9
Show file tree
Hide file tree
Showing 21 changed files with 211 additions and 126 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koodo-reader",
"main": "main.js",
"version": "1.5.7",
"version": "1.5.8",
"description": "A cross-platform ebook reader",
"author": {
"name": "App by Troye",
Expand Down
2 changes: 1 addition & 1 deletion public/lib/kookit/kookit.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/assets/locales/cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"Ascend": "升序",
"Sort by Name": "按书名",
"Turn on Bionic Reading": "开启仿生阅读",
"This process is inreversible, and will completely overwrite your current library, make sure you know what you're doing before proceeding": "这个过程是不可逆的,并且会完全覆盖现有的图书库,点击下一步之前请确保知道自己在做什么",
"Lemmatize words when looking up in a dictionary": "查询单词前将词性还原",
"To reduce the different forms of a word to one single form, for example, reducing builds, building or built to build, reducing cats to cat, reducing fastest to fast": "将不同变形的单词还原成单词原形,例如将builds, building 和 built 还原为 build,将cats还原为cat,fastest还原成fast",
"Export All Books": "导出所有图书",
Expand Down Expand Up @@ -274,7 +275,7 @@
"View Mode": "视图模式",
"Download Desktop Version": "下载客户端",
"No Favorite Books": "您喜爱的图书为空",
"Move your mouse on the top of any book, click the heart icon to add it to your favorite books": "将鼠标移动到任意书本上方,点击心形图标将图书添加到您喜爱的图书",
"Right click on any book and Click Add to Favorite to add it to your favorite books": "在任意图书上右键,点击添加到喜爱以将它添加您喜爱的图书",
"Empty Reading Records": "阅读记录为空",
"Empty Bookmark": "您的书签为空",
"Empty Note": "您的笔记为空",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"Light Mode": "Light Mode",
"Night Mode": "Night Mode",
"Turn on Bionic Reading": "Turn on Bionic Reading",
"This process is inreversible, and will completely overwrite your current library, make sure you know what you're doing before proceeding": "This process is inreversible, and will completely overwrite your current library, make sure you know what you're doing before proceeding",
"Lemmatize words when looking up in a dictionary": "查询单词前将词性还原",
"To reduce the different forms of a word to one single form, for example, reducing builds, building or built to build, reducing cats to cat, reducing fastest to fast": "To reduce the different forms of a word to one single form, for example, reducing builds, building or built to build, reducing cats to cat, reducing fastest to fast",
"Export All Books": "Export All Books",
Expand Down Expand Up @@ -290,7 +291,7 @@
"View Mode": "View Mode",
"Download Desktop Version": "Download Desktop Version",
"No Favorite Books": "No Favorite Books",
"Move your mouse on the top of any book, click the heart icon to add it to your favorite books": "Move your mouse on top of any book, click the heart icon to add it to your favorite books",
"Right click on any book and Click Add to Favorite to add it to your favorite books": "Right click on any book and Click Add to Favorite to add it to your favorite books",
"Empty Reading Records": "Empty Reading Records",
"Empty Bookmark": "Empty Bookmark",
"Empty Note": "Empty Note",
Expand Down
2 changes: 1 addition & 1 deletion src/components/bookCardItem/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BookCardItem extends React.Component<BookCardProps, BookCardState> {
{
left: x,
top:
document.body.clientHeight - e.clientY > 200
document.body.clientHeight - e.clientY > 250
? e.clientY
: e.clientY - 200,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/bookListItem/bookListItem.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/* overflow: hidden; */
border-radius: 1px;
display: inline-block;
margin-right: 12px;
}

.book-item-list-title {
Expand Down Expand Up @@ -43,6 +42,7 @@
font-size: 15px;
display: flex;
align-items: center;
padding-left: 10px;
}
.book-item-list-subtitle {
width: calc(100% - 250px);
Expand Down
2 changes: 1 addition & 1 deletion src/components/bookListItem/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class BookListItem extends React.Component<BookItemProps, BookItemState> {
}}
style={{ height: "65px" }}
>
<div className="book-item-image" style={{ height: "67px" }}>
<div className="book-item-image" style={{ height: "60px" }}>
<EmptyCover
{...{
format: this.props.book.format,
Expand Down
25 changes: 18 additions & 7 deletions src/components/dialogs/backupDialog/backupDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
top: 65px;
}
.backup-page-backup {
width: 152px;
height: 152px;
width: 142px;
height: 142px;
font-size: 18px;
line-height: 40px;
opacity: 1;
Expand All @@ -148,10 +148,10 @@
line-height: 20px;
opacity: 1;
position: absolute;
bottom: 11px;
bottom: 8px;
right: 27px;
cursor: pointer;
padding: 10px;
padding: 5px;
border-radius: 5px;
}
.backup-page-previous {
Expand All @@ -164,13 +164,24 @@
cursor: pointer;
}
.backup-page-backup-selector {
width: 152px;
height: 152px;
width: 142px;
height: 142px;
opacity: 1;
animation: popup 0.1s ease-in-out 0s 1;
margin-left: 49px;
margin-left: 54px;
margin-top: 5px;
border-radius: 5px;
}
.restore-warning {
font-size: 12px;
line-height: 1.25;
margin-top: 12px;
position: absolute;
bottom: 35px;
padding-left: 20px;
padding-right: 20px;
color: rgb(231, 69, 69);
}
.icon-local {
opacity: 1;
}
Expand Down
14 changes: 12 additions & 2 deletions src/components/dialogs/backupDialog/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import Lottie from "react-lottie";
import animationSuccess from "../../../assets/lotties/success.json";

import toast from "react-hot-toast";
import { isElectron } from "react-device-detect";declare var window: any;
import { isElectron } from "react-device-detect";
declare var window: any;
const successOptions = {
loop: false,
autoplay: true,
Expand Down Expand Up @@ -236,6 +237,15 @@ class BackupDialog extends React.Component<

return (
<div className="backup-page-container">
{this.state.currentStep === 0 && this.state.isBackup === "no" && (
<div className="restore-warning">
<Trans>
This process is inreversible, and will completely overwrite your
current library, make sure you know what you're doing before
proceeding
</Trans>
</div>
)}
{this.props.isOpenTokenDialog ? <TokenDialog {...dialogProps} /> : null}
{this.state.currentStep === 0 ? (
<div className="backup-page-title">
Expand Down Expand Up @@ -288,7 +298,7 @@ class BackupDialog extends React.Component<
}}
>
<span className="icon-restore"></span>
<div>
<div style={{ lineHeight: 1.0 }}>
<Trans>Restore</Trans>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/detailDialog/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class DetailDialog extends React.Component<
) : (
<div
className="detail-cover"
style={{ width: "130px", height: "170px" }}
style={{ width: "125px", height: "170px" }}
>
<EmptyCover
{...{
Expand Down
4 changes: 2 additions & 2 deletions src/components/imageViewer/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ class ImageViewer extends React.Component<ImageViewerProps, ImageViewerStates> {
this.props.handleLeaveReader("bottom");
}
await handleLinkJump(event, this.props.rendition);

if (
!event.target.getAttribute("src") ||
event.target.getAttribute("href") ||
event.target.parentNode.getAttribute("href") ||
event.target.parentNode.parentNode.getAttribute("href")
event.target.parentNode.getAttribute("href")
) {
return;
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/readerSettings/sliderList/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ class SliderList extends React.Component<SliderListProps, SliderListState> {
this.setState({ value: paraSpacing });
StorageUtil.setReaderConfig("paraSpacing", paraSpacing);
} else if (this.props.mode === "brightness") {
const brightness = event.target.value;
let brightness = event.target.value;
if (brightness < 0.3) {
brightness = 0.3;
}
this.setState({ value: brightness });
StorageUtil.setReaderConfig("brightness", brightness);
} else {
Expand Down
Loading

0 comments on commit 4fa3ed9

Please sign in to comment.