diff options
Diffstat (limited to 'lib/awprint/client/components')
| -rw-r--r-- | lib/awprint/client/components/App.jsx | 6 |
1 files changed, 5 insertions, 1 deletions
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 }) |
