summaryrefslogtreecommitdiff
path: root/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/modules/pix2pixhd/views/pix2pixhd.results.js')
-rw-r--r--app/client/modules/pix2pixhd/views/pix2pixhd.results.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
index d92a403..741060b 100644
--- a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
+++ b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
@@ -4,17 +4,24 @@ import { Link } from 'react-router-dom';
import { connect } from 'react-redux'
import util from '../../../util'
+import actions from '../../../actions'
+
import * as pix2pixhdActions from '../pix2pixhd.actions'
import * as pix2pixhdTasks from '../pix2pixhd.tasks'
import Loading from '../../../common/loading.component'
import { FileList, FileRow } from '../../../common/fileList.component'
+let yes_count = 0
+
class Pix2pixHDResults extends Component {
constructor(props){
super()
if (!props.pix2pixhd.results) props.actions.load_results()
}
+ componentDidMount(){
+ yes_count = 0
+ }
render(){
if (! this.props.pix2pixhd.results) return <Loading progress={this.props.pix2pixhd.progress} />
@@ -32,7 +39,20 @@ class Pix2pixHDResults extends Component {
linkFiles
files={files}
orderBy='date desc'
- fields={'name date size'}
+ fields={'name date size delete'}
+ onDelete={file => {
+ let yes;
+ if (yes_count < 3) {
+ yes = confirm('Are you sure you want to delete this file?')
+ } else {
+ yes = true
+ }
+ if (yes) {
+ yes_count += 1
+ console.log('delete: confirmed')
+ actions.file.destroy(file)
+ }
+ }}
/>
<br />