summaryrefslogtreecommitdiff
path: root/lib/awprint/client/components/App.jsx
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-06-01 20:58:21 -0400
committerJules Laplace <julescarbon@gmail.com>2017-06-01 20:58:21 -0400
commita5c00c4bb45102b676a6b0435c8b80c6908ecff1 (patch)
tree7c92538f84e5f194f8f6586577aaa7b8e5e5af58 /lib/awprint/client/components/App.jsx
parent3e72bfa56c860826429a842f6c128d78d4a930db (diff)
confirm reprints
Diffstat (limited to 'lib/awprint/client/components/App.jsx')
-rw-r--r--lib/awprint/client/components/App.jsx6
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 })