import { h, Component } from 'preact' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import { Route, Link } from 'react-router-dom' import moment from 'moment/min/moment.min' import util from '../../../util' import { FileViewer, Timeline, Param, Button, Group, TextInput } from '../../../common' import * as pix2pixhdTasks from '../pix2pixhd.tasks' import actions from '../../../actions' const initialState = { dir: '/', cursor: null, selection: null, title: null, } class SequenceEditor extends Component { state = { ...initialState } constructor() { super() this.handleCursor = this.handleCursor.bind(this) this.handleSelect = this.handleSelect.bind(this) } componentDidMount() { const { checkpoint } = this.props if (checkpoint) { this.reset() } } componentDidUpdate(prevProps) { const { checkpoint } = this.props if (checkpoint !== prevProps.checkpoint) { this.reset() } } reset(){ const { checkpoint } = this.props if (!(checkpoint && checkpoint.sequence)) return // console.log(checkpoint) this.setState({ ...initialState, title: checkpoint.name + '_' + moment().format("YYYYMMDD") }) } handleCursor(cursor) { this.setState({ cursor }) } handleSelect(selection) { this.setState({ selection }) } render() { const { app, pix2pixhd, remote, checkpoint, folder_id, processed } = this.props const { cursor, selection, title } = this.state const path = "sequences/" + checkpoint.name // console.log(checkpoint, pix2pixhd) return (