Skip to content
Snippets Groups Projects
Commit 05a3720d authored by john's avatar john
Browse files

attempt at saving upload state in localstorage

parent decfe90c
No related branches found
No related tags found
No related merge requests found
......@@ -28,8 +28,41 @@ export class Chapter extends React.Component {
this.setState({
isUploadInProgress: !this.state.isUploadInProgress
})
// if (!this.state.isUploadInProgress) this.removeUploadState()
}
// getLocalStorageKey () {
// const { chapter } = this.props
// return 'chapter:upload:' + chapter.id
// }
//
// persistUploadState () {
// const key = this.getLocalStorageKey()
// window.localStorage.setItem(key, true)
// }
//
// removeUploadState () {
// const key = this.getLocalStorageKey()
// window.localStorage.removeItem(key)
// }
//
// componentWillMount () {
// const key = this.getLocalStorageKey()
// var entry = window.localStorage.getItem(key)
// if (entry) {
// this.setState({
// isUploadInProgress: true
// })
// }
// }
//
// componentWillUnmount () {
// if (this.state.isUploadInProgress) {
// this.persistUploadState()
// }
// }
render () {
const {
book,
......@@ -51,6 +84,8 @@ export class Chapter extends React.Component {
opacity: isDragging ? 0 : 1
}
// TODO -- refactor these huge class names
// TODO -- make the dot and line component/s
return connectDragSource(connectDropTarget(
<li
className={styles.chapterContainer + ' col-lg-12 bb-chapter ' + (chapter.subCategory === 'chapter' ? styles.isChapter : styles.isPart)}
......
......@@ -114,9 +114,9 @@ export class Division extends React.Component {
<Chapter
book={book}
chapter={c}
key={c.index}
id={c.id}
ink={ink}
key={c.index}
move={_onMove}
no={i}
outerContainer={outerContainer}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment