diff --git a/js/app.js b/js/app.js index 9131885..29b3302 100644 --- a/js/app.js +++ b/js/app.js @@ -348,10 +348,19 @@ Anot({ this.isPlaying = true } else { if (SONIST.stat === 'ready') { - if (this.isPlaying) { - SONIST.pause() + if (this.curr.id) { + if (this.isPlaying) { + SONIST.pause() + } else { + SONIST.play() + } } else { - SONIST.play() + let lastPlay = Anot.ls('last-play') || 0 + SONIST.play(lastPlay).then(it => { + it.time = 0 + this.updateCurr(it) + this.draw() + }) } this.isPlaying = !this.isPlaying } diff --git a/js/modules/local.js b/js/modules/local.js index 3802e84..75715c3 100644 --- a/js/modules/local.js +++ b/js/modules/local.js @@ -44,17 +44,9 @@ export default Anot({ dbCache = null this.__APP__ = Anot.vmodels.app this.list = LS.getAll() - let lastPlay = Anot.ls('last-play') || 0 SONIST.clear() SONIST.push(LS.getAll()) - - // if (appInit.autoPlay) { - // SONIST.play(lastPlay).then(it => { - // this.__APP__.play(it) - // this.curr = it.id - // }) - // } }, watch: { 'props.curr'(v) {