Fixed save bug

Tweaked animations
Updated help page
This commit is contained in:
Max G 2019-07-30 20:46:24 +00:00
parent b2dc6e5218
commit 534bcb47cf
3 changed files with 21 additions and 7 deletions

View File

@ -151,6 +151,7 @@
vm.noteText = response.data.text vm.noteText = response.data.text
vm.updated = response.data.updated vm.updated = response.data.updated
vm.lastNoteHash = vm.hashString(response.data.text) vm.lastNoteHash = vm.hashString(response.data.text)
console.log(vm.lastNoteHash)
vm.color = response.data.color vm.color = response.data.color
this.fontColor = '#FFF' this.fontColor = '#FFF'
@ -229,10 +230,9 @@
//Don't save note if its hash doesn't change //Don't save note if its hash doesn't change
if( this.lastNoteHash == this.hashString(this.noteText) ){ if( this.lastNoteHash == this.hashString(this.noteText) ){
setTimeout(() => { console.log('Note was not modified')
resolve(true) resolve(false)
return return
}, 300)
} }
const postData = { const postData = {
@ -255,6 +255,7 @@
//Update last saved note hash //Update last saved note hash
vm.lastNoteHash = vm.hashString(vm.noteText) vm.lastNoteHash = vm.hashString(vm.noteText)
resolve(true) resolve(true)
return
}) })
}, 300) }, 300)
}) })
@ -274,8 +275,17 @@
}, },
close(){ close(){
this.sizeDown = true this.sizeDown = true
this.save().then( () => { this.save().then( result => {
//Save has a 300 ms timeout, if it saves animation will complete
if(result){
this.$bus.$emit('close_active_note', this.position) this.$bus.$emit('close_active_note', this.position)
return
} else {
//If save is not called, set timeout manually and then close after animation
setTimeout(() => {
this.$bus.$emit('close_active_note', this.position)
}, 300)
}
}) })
} }

View File

@ -25,6 +25,10 @@
<p>Italic Type *text* or _text_,</p> <p>Italic Type *text* or _text_,</p>
<p>Code Type `text`.</p> <p>Code Type `text`.</p>
<h2>Dark Theme</h2>
<p>Dark theme was desigend to minimize the amount of blue the app contains.</p>
<p>Making it easier to fall asleep at night.</p>
</div> </div>
</div> </div>
</template> </template>

View File

@ -48,7 +48,7 @@
<div class="ui right floated basic button" <div class="ui right floated basic button"
data-tooltip="Log Out" data-position="left center" data-tooltip="Log Out" data-position="left center"
v-on:click="destroyLoginToken">{{username}}</div> v-on:click="destroyLoginToken"><i class="user icon"></i> {{username}}</div>
</div> </div>
</div> </div>