Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
troyeguo committed Nov 5, 2023
1 parent 0abad9f commit 5f4e406
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/1bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
id: testing1
attributes:
label: I've already installed the latest developer version of Koodo Reader from Github Release, this problem still exsits
description: https://github.com/troyeguo/koodo-reader/releases/latest
description: https://github.com/koodo-reader/koodo-reader/releases/latest
options:
- label: "Yes"
required: true
Expand All @@ -16,7 +16,7 @@ body:
id: testing2
attributes:
label: There are no similar issues on the issue list
description: https://github.com/troyeguo/koodo-reader/issues
description: https://github.com/koodo-reader/koodo-reader/issues
options:
- label: "Yes"
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/4bug_report_cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
id: testing1
attributes:
label: 我已经从 Github Release 安装了最新开发版的 Koodo Reader,这个问题仍然存在
description: https://github.com/troyeguo/koodo-reader/releases/latest
description: https://github.com/koodo-reader/koodo-reader/releases/latest
options:
- label: "Yes"
required: true
Expand All @@ -15,7 +15,7 @@ body:
id: testing2
attributes:
label: 我已经搜索了已有的 issue 列表,没有找到类似的 issue
description: https://github.com/troyeguo/koodo-reader/issues
description: https://github.com/koodo-reader/koodo-reader/issues
options:
- label: "Yes"
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Questions and Discussions
url: https://github.com/troyeguo/koodo-reader/discussions
url: https://github.com/koodo-reader/koodo-reader/discussions
about: Looking for help or Starting a discussion about Koodo Reader
- name: 提问与讨论
url: https://github.com/troyeguo/koodo-reader/discussions
url: https://github.com/koodo-reader/koodo-reader/discussions
about: 使用 Koodo Reader 时遇到了问题,或者想发起一个讨论
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Code Contributing Guide

You can find features to work on through our [Roadmap](https://troyeguo.notion.site/d1c19a132932465bae1d89dd963c92ea?v=ca8aa69cf25849c18c92b92ba868663b), or find bugs to fix through our [Issues](https://github.com/troyeguo/koodo-reader/issues). If you want to add new features or fix new bugs, please report them in [Issue](https://github.com/troyeguo/koodo-reader/issues) first.
You can find features to work on through our [Roadmap](https://koodo-reader.notion.site/d1c19a132932465bae1d89dd963c92ea?v=ca8aa69cf25849c18c92b92ba868663b), or find bugs to fix through our [Issues](https://github.com/koodo-reader/koodo-reader/issues). If you want to add new features or fix new bugs, please report them in [Issue](https://github.com/koodo-reader/koodo-reader/issues) first.

- Make sure you're already familiar with our project structure, code style, naming style.
- Does not upgrade or degrade dependency version, this could potentially break the project
Expand All @@ -13,4 +13,4 @@ Koodo Reader use POEditor to manage localization, Visit [here](https://poeditor.

## Other Contributing Methods

Help with [Issues](https://github.com/troyeguo/koodo-reader/issues) or join [Discussions](https://github.com/troyeguo/koodo-reader/discussions)
Help with [Issues](https://github.com/koodo-reader/koodo-reader/issues) or join [Discussions](https://github.com/koodo-reader/koodo-reader/discussions)
4 changes: 2 additions & 2 deletions CONTRIBUTING_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 代码贡献指南

您可以借助 Koodo Reader 的[开发计划](https://troyeguo.notion.site/215baeda57804fd29dbb0e91d1e6a021?v=360c00183d944b598668f34c255edfd7)了解 Koodo Reader 的开发需求,通过 [Issues](https://github.com/troyeguo/koodo-reader/issues) 了解 Koodo Reader 的 bug,然后通过 Pull Requests 的方式提交您的代码。如果您有新需求或发现新 bug 请先到[Issues](https://github.com/troyeguo/koodo-reader/issues)反馈,经开发者确认之后,再进行后续的开发工作。
您可以借助 Koodo Reader 的[开发计划](https://troyeguo.notion.site/215baeda57804fd29dbb0e91d1e6a021?v=360c00183d944b598668f34c255edfd7)了解 Koodo Reader 的开发需求,通过 [Issues](https://github.com/koodo-reader/koodo-reader/issues) 了解 Koodo Reader 的 bug,然后通过 Pull Requests 的方式提交您的代码。如果您有新需求或发现新 bug 请先到[Issues](https://github.com/koodo-reader/koodo-reader/issues)反馈,经开发者确认之后,再进行后续的开发工作。

- 参与项目的前提是您已经熟悉本项目的结构,代码风格,命名规范
- 请勿升级或降级依赖版本
Expand All @@ -13,4 +13,4 @@

## 其他贡献方式

您可以在[Issues](https://github.com/troyeguo/koodo-reader/issues)提交新需求和新 Bug。或者帮助解决[Discussions](https://github.com/troyeguo/koodo-reader/discussions)中其他用户遇到的问题。
您可以在[Issues](https://github.com/koodo-reader/koodo-reader/issues)提交新需求和新 Bug。或者帮助解决[Discussions](https://github.com/koodo-reader/koodo-reader/discussions)中其他用户遇到的问题。
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RUN apt-get update && apt-get install -y jq curl wget python3
WORKDIR /app

### Get the latest release source code tarball
RUN tarball_url=$(curl -s https://api.github.com/repos/troyeguo/koodo-reader/releases/latest | jq -r ".tarball_url") \
RUN tarball_url=$(curl -s https://api.github.com/repos/koodo-reader/koodo-reader/releases/latest | jq -r ".tarball_url") \
&& wget -qO- $tarball_url \
| tar xvfz - --strip 1

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="left">

[简体中文](https://github.com/troyeguo/koodo-reader/blob/master/README_cn.md) | [Português](https://github.com/troyeguo/koodo-reader/blob/master/README_pt.md) | English
[简体中文](https://github.com/koodo-reader/koodo-reader/blob/master/README_cn.md) | [Português](https://github.com/koodo-reader/koodo-reader/blob/master/README_pt.md) | English

</div>

Expand Down Expand Up @@ -53,7 +53,7 @@

- Desktop Version:
- Stable Version (Recommended): [Download](https://koodo.960960.xyz/en)
- Developer Version: [Download](https://github.com/troyeguo/koodo-reader/releases/latest) ( With new feature and bug fix, but may induce some unknown bugs)
- Developer Version: [Download](https://github.com/koodo-reader/koodo-reader/releases/latest) ( With new feature and bug fix, but may induce some unknown bugs)
- Web Version:[Preview](https://reader.960960.xyz)
- Install with Scoop:

Expand Down Expand Up @@ -116,7 +116,7 @@ Make sure that you have installed yarn and git
1. Download the repo

```
git clone https://github.com/troyeguo/koodo-reader.git
git clone https://github.com/koodo-reader/koodo-reader.git
```

2. Enter desktop mode
Expand Down
6 changes: 3 additions & 3 deletions README_cn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="left">

简体中文 | [Português](https://github.com/troyeguo/koodo-reader/blob/master/README_pt.md) | [English](https://github.com/troyeguo/koodo-reader/blob/master/README.md)
简体中文 | [Português](https://github.com/koodo-reader/koodo-reader/blob/master/README_pt.md) | [English](https://github.com/koodo-reader/koodo-reader/blob/master/README.md)

</div>

Expand Down Expand Up @@ -53,7 +53,7 @@

- 桌面端:
- 稳定版 (推荐下载):[官网](https://koodo.960960.xyz/zh)(感谢 [@Stille](https://www.ioiox.com/donate.html) 提供下载加速服务)
- 开发版:[Github Release](https://github.com/troyeguo/koodo-reader/releases/latest) (包含新功能和 bug 修复,但也可能引入更多未知 bug)
- 开发版:[Github Release](https://github.com/koodo-reader/koodo-reader/releases/latest) (包含新功能和 bug 修复,但也可能引入更多未知 bug)
- 网页版:[前往](https://reader.960960.xyz)
- 使用 Scoop 安装:

Expand Down Expand Up @@ -113,7 +113,7 @@ flatpak run io.github.troyeguo.koodo-reader
1. 将项目源码下载到本地

```
git clone https://github.com/troyeguo/koodo-reader.git
git clone https://github.com/koodo-reader/koodo-reader.git
```

2. cd 到项目文件夹,运行以下代码进入客户端模式
Expand Down
6 changes: 3 additions & 3 deletions README_pt.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="left">

[简体中文](https://github.com/troyeguo/koodo-reader/blob/master/README_cn.md) | Português | [English](https://github.com/troyeguo/koodo-reader/blob/master/README.md)
[简体中文](https://github.com/koodo-reader/koodo-reader/blob/master/README_cn.md) | Português | [English](https://github.com/koodo-reader/koodo-reader/blob/master/README.md)

</div>

Expand Down Expand Up @@ -53,7 +53,7 @@

- Versão para computador:
- Versão estável (Recomendada): [Baixar](https://koodo.960960.xyz/en)
- Versão do desenvolvedor: [Baixar](https://github.com/troyeguo/koodo-reader/releases/latest) ( Com novos recursos e correção de bugs, mas podendo ainda conter alguns problemas desconhecidos)
- Versão do desenvolvedor: [Baixar](https://github.com/koodo-reader/koodo-reader/releases/latest) ( Com novos recursos e correção de bugs, mas podendo ainda conter alguns problemas desconhecidos)
- Versão para Web:[Pré-visualizar](https://reader.960960.xyz)
- Instalar com o Scoop:

Expand Down Expand Up @@ -116,7 +116,7 @@ Certifique-se de ter instalado yarn e git, a versão.
1. Baixe o repositório

```
git clone https://github.com/troyeguo/koodo-reader.git
git clone https://github.com/koodo-reader/koodo-reader.git
```

2. Entre no modo desktop
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"node": "18.x",
"npm": ">=6.0.0"
},
"repository": "https://github.com/troyeguo/koodo-reader",
"repository": "https://github.com/koodo-reader/koodo-reader",
"private": false,
"resolutions": {
"//": "See https://github.com/facebook/create-react-app/issues/11773",
Expand Down
4 changes: 2 additions & 2 deletions public/lib/kookit/kookit.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/bookCardItem/bookCardItem.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
width: 80%;
margin-left: 10%;
/* margin-bottom: 5px; */
height: 32px;
height: 31px;
font-size: 12px;
line-height: 15px;
opacity: 1;
Expand Down
3 changes: 2 additions & 1 deletion src/components/bookCardItem/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class BookCardItem extends React.Component<BookCardProps, BookCardState> {
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onClick={() => {
onClick={(event) => {
if (this.props.isSelectBook) {
this.props.handleSelectedBooks(
this.props.isSelected
Expand All @@ -213,6 +213,7 @@ class BookCardItem extends React.Component<BookCardProps, BookCardState> {
this.props.handleSelectedBooks([this.props.book.key]);
}
this.setState({ isHover: false });
event?.stopPropagation();
}}
style={this.props.isSelected ? { opacity: 1 } : { color: "#eee" }}
></span>
Expand Down
3 changes: 2 additions & 1 deletion src/components/bookCoverItem/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class BookCoverItem extends React.Component<BookCoverProps, BookCoverState> {
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onClick={() => {
onClick={(event) => {
if (this.props.isSelectBook) {
this.props.handleSelectedBooks(
this.props.isSelected
Expand All @@ -259,6 +259,7 @@ class BookCoverItem extends React.Component<BookCoverProps, BookCoverState> {
this.props.handleSelectedBooks([this.props.book.key]);
}
this.setState({ isHover: false });
event?.stopPropagation();
}}
style={
this.props.isSelected
Expand Down
3 changes: 2 additions & 1 deletion src/components/bookListItem/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class BookListItem extends React.Component<BookItemProps, BookItemState> {
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onClick={() => {
onClick={(event) => {
if (this.props.isSelectBook) {
this.props.handleSelectedBooks(
this.props.isSelected
Expand All @@ -246,6 +246,7 @@ class BookListItem extends React.Component<BookItemProps, BookItemState> {
this.props.handleSelectedBooks([this.props.book.key]);
}
this.setState({ isHover: false });
event?.stopPropagation();
}}
style={
this.props.isSelected
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/aboutDialog/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class AboutDialog extends React.Component<AboutDialogProps, AboutDialogState> {
<li
className="sort-by-category-list"
onClick={() => {
this.handleJump("https://github.com/troyeguo/koodo-reader");
this.handleJump("https://github.com/koodo-reader/koodo-reader");
}}
>
<Trans>Github Repo</Trans>
Expand Down
17 changes: 13 additions & 4 deletions src/components/selectBook/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
exportNotes,
} from "../../utils/syncUtils/exportUtil";
import BookUtil from "../../utils/fileUtils/bookUtil";
import ShelfUtil from "../../utils/readUtils/shelfUtil";
declare var window: any;
class SelectBook extends React.Component<BookListProps, BookListState> {
constructor(props: BookListProps) {
Expand All @@ -21,7 +22,11 @@ class SelectBook extends React.Component<BookListProps, BookListState> {
favoriteBooks: Object.keys(AddFavorite.getAllFavorite()).length,
};
}

handleFilterShelfBook = (items: BookModel[]) => {
return items.filter((item) => {
return ShelfUtil.getBookPosition(item.key).length === 0;
});
};
render() {
return (
<div
Expand Down Expand Up @@ -245,17 +250,21 @@ class SelectBook extends React.Component<BookListProps, BookListState> {
className="book-manage-title"
onClick={() => {
if (
this.props.selectedBooks.length === this.props.books.length
this.props.selectedBooks.length ===
this.handleFilterShelfBook(this.props.books).length
) {
this.props.handleSelectedBooks([]);
} else {
this.props.handleSelectedBooks(
this.props.books.map((item) => item.key)
this.handleFilterShelfBook(this.props.books).map(
(item) => item.key
)
);
}
}}
>
{this.props.selectedBooks.length === this.props.books.length ? (
{this.props.selectedBooks.length ===
this.handleFilterShelfBook(this.props.books).length ? (
<Trans>Deselect All</Trans>
) : (
<Trans>Select All</Trans>
Expand Down
3 changes: 1 addition & 2 deletions src/components/viewMode/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ class ViewMode extends React.Component<ViewModeProps, ViewModeState> {
const lazyImages: any = document.querySelectorAll(".lazy-image");

lazyImages.forEach((lazyImage) => {
if (this.isElementInViewport(lazyImage)) {
if (this.isElementInViewport(lazyImage) && lazyImage.dataset.src) {
lazyImage.src = lazyImage.dataset.src;
lazyImage.dataset.src = "";
lazyImage.classList.remove("lazy-image");
}
});
Expand Down
7 changes: 5 additions & 2 deletions src/containers/htmlViewer/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,11 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
: {}
}
></div>
{StorageUtil.getReaderConfig("isHideBackground") === "yes" ? null : this
.props.currentBook.key ? (
{StorageUtil.getReaderConfig("isHideBackground") === "yes" ||
(StorageUtil.getReaderConfig("backgroundColor") &&
StorageUtil.getReaderConfig("backgroundColor").startsWith(
"#"
)) ? null : this.props.currentBook.key ? (
<Background />
) : null}
{this.props.htmlBook ? (
Expand Down
2 changes: 1 addition & 1 deletion src/containers/lists/bookList/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class BookList extends React.Component<BookListProps, BookListState> {
lazyLoad = () => {
const lazyImages: any = document.querySelectorAll(".lazy-image");
lazyImages.forEach((lazyImage) => {
if (this.isElementInViewport(lazyImage)) {
if (this.isElementInViewport(lazyImage) && lazyImage.dataset.src) {
lazyImage.src = lazyImage.dataset.src;
lazyImage.classList.remove("lazy-image");
}
Expand Down
12 changes: 1 addition & 11 deletions src/containers/lists/deletedBookList/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,11 @@ class BookList extends React.Component<BookListProps, BookListState> {
const lazyImages: any = document.querySelectorAll(".lazy-image");

lazyImages.forEach((lazyImage) => {
if (this.isElementInViewport(lazyImage)) {
if (this.isElementInViewport(lazyImage) && lazyImage.dataset.src) {
lazyImage.src = lazyImage.dataset.src;
lazyImage.dataset.src = "";
lazyImage.classList.remove("lazy-image");
}
});
const coverImages: any = document.querySelectorAll(".book-item-cover");
coverImages.forEach((coverImage) => {
if (this.isElementInViewport(coverImage)) {
if (coverImage.dataset.src) {
coverImage.src = coverImage.dataset.src;
coverImage.dataset.src = "";
}
}
});
};
isElementInViewport = (element) => {
const rect = element.getBoundingClientRect();
Expand Down
5 changes: 1 addition & 4 deletions src/containers/panels/navigationPanel/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,7 @@ class NavigationPanel extends React.Component<
<span className="icon-close"></span>
</div>

<div
className="header-search-container"
style={this.state.isSearch ? { left: 40 } : {}}
>
<div className="header-search-container">
<div
className="navigation-search-title"
style={{ height: "20px", margin: "0px 25px 13px" }}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/manager/manager.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
height: 300px;
position: absolute;
top: 80px;
right: 140px;
right: 0px;
text-align: center;
}
.waring-title {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/readUtils/linkUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { openExternalUrl } from "../serviceUtils/urlUtil";

export const handleLinkJump = async (event: any, rendition: any = {}) => {
let href;
if (event.target && event.target.parentNode) {
if (event.target) {
href =
(event.target.innerText &&
event.target.innerText.indexOf("http") > -1 &&
event.target.innerText) ||
event.target.getAttribute("href") ||
event.target.parentNode.getAttribute("href") ||
event.target.getAttribute("src") ||
"";
}
Expand Down

0 comments on commit 5f4e406

Please sign in to comment.