diff --git a/api/src/routes/images.js b/api/src/routes/images.js index 8c514a14..0c0d4c97 100644 --- a/api/src/routes/images.js +++ b/api/src/routes/images.js @@ -18,8 +18,6 @@ function loadImageRoutes({ app, driver, scanner }) { return res.status(401).send(err.message) } - console.log('Getting image for user', user.username) - const session = driver.session() const result = await session.run( diff --git a/ui/src/components/photoGallery/PhotoGallery.js b/ui/src/components/photoGallery/PhotoGallery.js index 032dd4db..289d9296 100644 --- a/ui/src/components/photoGallery/PhotoGallery.js +++ b/ui/src/components/photoGallery/PhotoGallery.js @@ -127,6 +127,7 @@ class PhotoGallery extends React.Component { diff --git a/ui/src/components/photoGallery/PresentView.js b/ui/src/components/photoGallery/PresentView.js index bd7893d6..8b2af036 100644 --- a/ui/src/components/photoGallery/PresentView.js +++ b/ui/src/components/photoGallery/PresentView.js @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useState } from 'react' import styled, { createGlobalStyle } from 'styled-components' import { Query } from 'react-apollo' import gql from 'graphql-tag' @@ -42,37 +42,44 @@ const PresentImage = styled(ProtectedImage)` object-position: center; ` -export default class PresentView extends React.Component { - render() { - const { image, presenting } = this.props - - if (!image || !presenting) { - return null - } - - return ( - - - - {({ loading, error, data }) => { - if (loading) return 'Loading...' - if (error) return error - - const { photo } = data - - console.log(photo) - - return ( -
- -
- ) - }} -
-
- ) +const PresentView = ({ + image, + presenting, + thumbnail, + imageLoaded: imageLoadedCallback, +}) => { + if (!image || !presenting) { + return null } + + return ( + + + + {({ loading, error, data }) => { + if (error) return error + + let original = null + if (!loading) { + const { photo } = data + original = ( + + ) + } + + return ( +
+ + {original} +
+ ) + }} +
+
+ ) } + +export default PresentView diff --git a/ui/src/components/photoGallery/ProtectedImage.js b/ui/src/components/photoGallery/ProtectedImage.js index 444f638a..8ce87e42 100644 --- a/ui/src/components/photoGallery/ProtectedImage.js +++ b/ui/src/components/photoGallery/ProtectedImage.js @@ -5,7 +5,6 @@ let imageCache = {} export async function fetchProtectedImage(src) { if (src) { if (imageCache[src]) { - console.log('Found image from cache', src) return imageCache[src] } @@ -18,11 +17,6 @@ export async function fetchProtectedImage(src) { image = await image.blob() const url = URL.createObjectURL(image) - console.log( - `Saved image to cache, ${src}. New cache size: ${ - Object.keys(imageCache).length - }` - ) imageCache[src] = url return url