Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
panaC committed Oct 5, 2024
1 parent a142f20 commit 39dda4d
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/main/redux/sagas/win/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function* winOpen(action: winActions.reader.openSucess.TAction) {
const readerWin = action.payload.win;
const webContents = readerWin.webContents;
const locale = yield* selectTyped((_state: RootState) => _state.i18n.locale);
// HERE
const reader = yield* selectTyped((_state: RootState) => _state.win.session.reader[identifier]);
const readerDefaultConfig = yield* selectTyped((_state: RootState) => _state.reader.defaultConfig);
const keyboard = yield* selectTyped((_state: RootState) => _state.keyboard);
Expand Down
6 changes: 2 additions & 4 deletions src/main/services/lcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { lcpHashesFilePath } from "../di";
import { lcpActions } from "../redux/actions";
import { extractCrc32OnZip } from "../tools/crc";
import { LSDManager } from "./lsd";
import { translate } from "readium-desktop/common/services/translator";
import { getTranslator } from "readium-desktop/common/services/translator";

// import { Server } from "@r2-streamer-js/http/server";

Expand Down Expand Up @@ -84,9 +84,7 @@ export class LcpManager {
@inject(diSymbolTable["lsd-manager"])
private readonly lsdManager!: LSDManager;

private translator = {
translate: translate,
};
private translator = getTranslator();

public async absorbDBToJson() {
await this.getAllSecrets();
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/common/components/toast/ToastManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class ToastManager extends React.Component<IProps, IState> {
const mapStateToProps = (state: IRendererCommonRootState, _props: IBaseProps) => {
return {
toast: state.toast,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const mapStateToProps = (state: ILibraryRootState, _props: IBaseProps) => {

return {
// here
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
newVersionURL: state.versionUpdate.newVersionURL,
newVersion: state.versionUpdate.newVersion,
};
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/library/components/catalog/Catalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const mapStateToProps = (state: ILibraryRootState) => ({
catalog: state.publication.catalog,
tags: state.publication.tag,
keyboardShortcuts: state.keyboard.shortcuts,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
});

const mapDispatchToProps = (dispatch: Dispatch) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/library/components/catalog/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Header extends React.Component<IProps, undefined> {

const mapStateToProps = (state: ILibraryRootState) => ({
location: state.router.location,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
});

export default connect(mapStateToProps)(withTranslator(Header));
2 changes: 1 addition & 1 deletion src/renderer/library/components/dialog/FileImport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class FileImport extends React.Component<IProps, undefined> {
const mapStateToProps = (state: ILibraryRootState, _props: IBaseProps) => ({
open: state.dialog.type === DialogTypeName.FileImport,
files: (state.dialog.data as DialogType[DialogTypeName.FileImport]).files,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
});

const mapDispatchToProps = (dispatch: TDispatch, _props: IBaseProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const mapStateToProps = (state: ILibraryRootState) => ({
pubId: (state.dialog.data as DialogType[DialogTypeName.PublicationInfoLib])?.publication?.identifier,
publication: (state.dialog.data as DialogType[DialogTypeName.PublicationInfoLib])?.publication,
location: state.router.location,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
});

const mapDispatchToProps = (dispatch: TDispatch, _props: IBaseProps) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/library/components/layout/LibraryLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ const mapStateToProps = (state: ILibraryRootState, _props: IBaseProps) => ({
location: state.router.location,
headerLinks: state.opds.browser.header,
breadcrumb: state.opds.browser.breadcrumb,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
});

export default connect(mapStateToProps)(withTranslator(LibraryLayout));
2 changes: 1 addition & 1 deletion src/renderer/library/components/opds/BrowserResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const mapStateToProps = (state: ILibraryRootState, _props: IBaseProps) => {
browserData: apiBrowseData?.data,
location: state.router.location,
level: state.opds.browser.breadcrumb.length + 1,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
};
};

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/library/components/opds/FeedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const mapDispatchToProps = (dispatch: TDispatch, _props: IBaseProps) => {

const mapStateToProps = (state: ILibraryRootState) => ({
location: state.router.location,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
});

export default connect(mapStateToProps, mapDispatchToProps)(withTranslator(FeedList));
2 changes: 1 addition & 1 deletion src/renderer/library/components/opds/PageNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class PageNavigation extends React.Component<IProps, undefined> {
const mapStateToProps = (state: ILibraryRootState) => ({
location: state.router.location,
keyboardShortcuts: state.keyboard.shortcuts,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
});

const mapDispatchToProps = (dispatch: TDispatch) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class KeyboardSettings extends React.Component<IProps, IState> {
const mapStateToProps = (state: ILibraryRootState, _props: IBaseProps) => {
return {
keyboardShortcuts: state.keyboard.shortcuts,
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class LanguageSettings extends React.Component<IProps, undefined> {

const mapStateToProps = (state: ILibraryRootState, _props: IBaseProps) => {
return {
locale: state.i18n.locale,
locale: state.i18n.locale, // refresh
};
};

Expand Down
3 changes: 0 additions & 3 deletions src/renderer/reader/components/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2880,9 +2880,6 @@ const mapStateToProps = (state: IReaderRootState, _props: IBaseProps) => {
readerMode: state.mode,
divinaReadingMode: state.reader.divina.readingMode,
locale: state.i18n.locale,
// HERE
// session: state.session.state,

disableRTLFlip: !!state.reader.disableRTLFlip?.disabled,
r2PublicationHasMediaOverlays: state.reader.info.navigator.r2PublicationHasMediaOverlays,
ttsState: state.reader.tts.state,
Expand Down

0 comments on commit 39dda4d

Please sign in to comment.