Fix flow error.

Partial fix for #2024
This commit is contained in:
Jeffrey Fisher 2020-04-21 00:16:39 -07:00 committed by Sean Yesmunt
parent 7e3c0143d1
commit e6a044d8e1
2 changed files with 4 additions and 7 deletions

View file

@ -168,7 +168,7 @@ class FileRender extends React.PureComponent<Props, State> {
/>
);
case RENDER_MODES.COMIC:
return <ComicBookViewer source={{ fileExtension, downloadPath }} theme={currentTheme} />;
return <ComicBookViewer source={downloadPath} theme={currentTheme} />;
case RENDER_MODES.APPLICATION:
return <AppViewer uri={uri} />;
}

View file

@ -5,10 +5,7 @@ import 'villain-react/dist/style.css';
type Props = {
theme: string,
source: {
fileType: string,
downloadPath: string,
},
source: string,
};
let workerUrl = 'webworkers/worker-bundle.js';
@ -20,9 +17,9 @@ if (process.env.NODE_ENV !== 'production') {
class ComicBookViewer extends React.PureComponent<Props> {
render() {
const { downloadPath } = this.props.source || {};
const { source } = this.props || {};
// Archive source
const file = `file://${downloadPath}`;
const file = `file://${source}`;
// Villain options
const opts = {
theme: this.props.theme === 'dark' ? 'Dark' : 'Light',