From a5c00c4bb45102b676a6b0435c8b80c6908ecff1 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 1 Jun 2017 20:58:21 -0400 Subject: confirm reprints --- lib/awprint/client/components/App.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/awprint/client/components') diff --git a/lib/awprint/client/components/App.jsx b/lib/awprint/client/components/App.jsx index 4c4f9be..f1a66cd 100644 --- a/lib/awprint/client/components/App.jsx +++ b/lib/awprint/client/components/App.jsx @@ -3,6 +3,7 @@ import React from 'react' import Modal from './Modal.jsx' const MAX_JOB_SIZE = 120 +const CONFIRM_REPRINT_MESSAGE = "This photo has already been printed. Print again?" export default class App extends React.Component { constructor(props) { @@ -31,11 +32,14 @@ export default class App extends React.Component { let jobs = this.state.jobs if (this.state.jobs.length > MAX_JOB_SIZE) this.state.jobs.pop() jobs.unshift(job) - console.log(job) this.setState({ jobs }) } print(job) { + if (job.printed) { + var shouldPrint = confirm(CONFIRM_REPRINT_MESSAGE) + if (! shouldPrint) return + } job.printed = true this.setState({ modalVisible: true }) -- cgit v1.2.3-70-g09d2