From 966ba06bc4e742a774fff2e402a98dc6d5fad2fa Mon Sep 17 00:00:00 2001 From: Razvan Moraru Date: Thu, 23 Mar 2017 17:50:39 +0100 Subject: [PATCH] change let to const --- browser/main/Detail/SnippetNoteDetail.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index d80ccdae..bb2c4912 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -251,10 +251,10 @@ class SnippetNoteDetail extends React.Component { deleteSnippetByIndex (index) { this.setState(() => { - let snippets = this.state.note.snippets.slice() + const snippets = this.state.note.snippets.slice() snippets.splice(index, 1) - let note = Object.assign({}, this.state.note, {snippets}) - let snippetIndex = this.state.snippetIndex >= snippets.length + const note = Object.assign({}, this.state.note, {snippets}) + const snippetIndex = this.state.snippetIndex >= snippets.length ? snippets.length - 1 : this.state.snippetIndex