Fix bug showing/saving in error view
This commit is contained in:
parent
fac1a38636
commit
21e82e26ef
|
@ -10,7 +10,7 @@ class ErrorView {
|
||||||
const $token = this.$view.find('input[name="token"]')
|
const $token = this.$view.find('input[name="token"]')
|
||||||
const $submit = this.$view.find('button[type="submit"]')
|
const $submit = this.$view.find('button[type="submit"]')
|
||||||
const $help = $submit.next()
|
const $help = $submit.next()
|
||||||
const token = this.store.get(STORE.TOKEN, true)
|
const token = this.store.get(STORE.TOKEN)
|
||||||
|
|
||||||
this.$view.find('.octotree_view_header').html(err.error)
|
this.$view.find('.octotree_view_header').html(err.error)
|
||||||
this.$view.find('.message').html(err.message)
|
this.$view.find('.message').html(err.message)
|
||||||
|
@ -35,12 +35,12 @@ class ErrorView {
|
||||||
|
|
||||||
const $error = this.$view.find('.error').text('')
|
const $error = this.$view.find('.error').text('')
|
||||||
const $token = this.$view.find('[name="token"]')
|
const $token = this.$view.find('[name="token"]')
|
||||||
const oldToken = this.store.get(STORE.TOKEN, true)
|
const oldToken = this.store.get(STORE.TOKEN)
|
||||||
const newToken = $token.val()
|
const newToken = $token.val()
|
||||||
|
|
||||||
if (!newToken) return $error.text('Token is required')
|
if (!newToken) return $error.text('Token is required')
|
||||||
|
|
||||||
this.store.set(STORE.TOKEN, newToken, true, () => {
|
this.store.set(STORE.TOKEN, newToken, () => {
|
||||||
const changes = {[STORE.TOKEN]: [oldToken, newToken]}
|
const changes = {[STORE.TOKEN]: [oldToken, newToken]}
|
||||||
$(this).trigger(EVENT.OPTS_CHANGE, changes)
|
$(this).trigger(EVENT.OPTS_CHANGE, changes)
|
||||||
$token.val('')
|
$token.val('')
|
||||||
|
|
Loading…
Reference in New Issue