summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-09-22 20:08:32 +0200
committerJules Laplace <julescarbon@gmail.com>2018-09-22 20:08:32 +0200
commitf3885f7d43dffe4e0fcf49e3e8f9f9e248bc6f76 (patch)
tree2a6b3d92c91790bf13cf436e24d14f76be4ef0ab /app
parentcb252ec2533fb4d2cd739d60da7c5e9a8494fba5 (diff)
thumbnail
Diffstat (limited to 'app')
-rw-r--r--app/client/common/fileViewer.component.js6
-rw-r--r--app/relay/system.js1
2 files changed, 4 insertions, 3 deletions
diff --git a/app/client/common/fileViewer.component.js b/app/client/common/fileViewer.component.js
index d9f3f4b..d98073b 100644
--- a/app/client/common/fileViewer.component.js
+++ b/app/client/common/fileViewer.component.js
@@ -36,25 +36,27 @@ class FileViewer extends Component {
return
}
const fn = [path || file.path, file.name].join('/').replace('//','/')
- console.log('fetch file', fn)
const { tool: module } = this.props.app
this.setState({ buffer: null, loading: true })
if (thumbnail) {
+ console.log('fetch thumbnail', fn)
const size = parseInt(thumbnail) || 200
actions.socket
.thumbnail({ module, fn, size })
.then(this.loadBuffer.bind(this))
} else {
+ console.log('fetch file', fn)
actions.socket
.read_file({ module, fn })
.then(this.loadBuffer.bind(this))
}
}
loadBuffer(buffer) {
- console.log('fetched buffer')
+ console.log('fetched buffer', buffer)
const { stale } = this.state
this.setState({ buffer, loading: false, stale: false, }, () => {
+ console.log('loaded')
if (stale) {
console.log('stale, fetching...')
this.fetch()
diff --git a/app/relay/system.js b/app/relay/system.js
index 49b8c33..e8feee8 100644
--- a/app/relay/system.js
+++ b/app/relay/system.js
@@ -110,7 +110,6 @@ export function thumbnail(opt, cb) {
.jpeg({ quality: opt.quality || THUMBNAIL_QUALITY })
.toBuffer()
.then(buf => cb({
- error: err,
name: opt.fn,
path: fn,
date: stat.ctime,