From f3885f7d43dffe4e0fcf49e3e8f9f9e248bc6f76 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 22 Sep 2018 20:08:32 +0200 Subject: thumbnail --- app/client/common/fileViewer.component.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/client/common') 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() -- cgit v1.2.3-70-g09d2