diff options
| author | jules <jules@carbonpictures.com> | 2017-06-02 15:42:34 +0000 |
|---|---|---|
| committer | jules <jules@carbonpictures.com> | 2017-06-02 15:42:34 +0000 |
| commit | 5f26431f03228a85273e7f7d51abd6098ea9f2a5 (patch) | |
| tree | 6a709972cbb0babd68aaa10fe277b2c843fd7451 /lib/awprint/client/components | |
| parent | 291fe3eedd9a460fc44d2ea3ea81c7d79f2dfbcf (diff) | |
| parent | dd70fa81a205304cb48bbc0494ad34c16d496ff2 (diff) | |
merge
Diffstat (limited to 'lib/awprint/client/components')
| -rw-r--r-- | lib/awprint/client/components/App.jsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/awprint/client/components/App.jsx b/lib/awprint/client/components/App.jsx index 4c4f9be..29797d2 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 }) @@ -77,7 +81,7 @@ export default class App extends React.Component { const className = job.printed ? 'print printed' : 'print' const datePartz = job.date.split('T') const timePartz = datePartz[1].split(':') - const hour = Number(timePartz[0]) - 4 + const hour = Number(timePartz[0]) const mins = timePartz[1] const date = datePartz[0] + ' - ' + hour + ':' + mins return ( |
