[Client] Fix bug

This commit is contained in:
syuilo 2017-03-14 07:05:59 +09:00
parent 585b4ec89d
commit c26a6cfc37

View file

@ -1,15 +1,18 @@
<mk-users-list> <mk-users-list>
<nav><span data-is-active={ mode == 'all' } onclick={ setMode.bind(this, 'all') }>すべて<span>{ opts.count }</span></span> <nav>
<!-- ↓ https://github.com/riot/riot/issues/2080--><span if={ SIGNIN && opts.youKnowCount != '' } data-is-active={ mode == 'iknow' } onclick={ setMode.bind(this, 'iknow') }>知り合い<span>{ opts.youKnowCount }</span></span> <span data-is-active={ mode == 'all' } onclick={ setMode.bind(this, 'all') }>すべて<span>{ opts.count }</span></span>
<!-- ↓ https://github.com/riot/riot/issues/2080-->
<span if={ SIGNIN && opts.youKnowCount != '' } data-is-active={ mode == 'iknow' } onclick={ setMode.bind(this, 'iknow') }>知り合い<span>{ opts.youKnowCount }</span></span>
</nav> </nav>
<div class="users" if={ !fetching && users.length != 0 }> <div class="users" if={ !fetching && users.length != 0 }>
<mk-user-preview each={ users } user={ this }></mk-user-preview> <mk-user-preview each={ users } user={ this }></mk-user-preview>
</div> </div>
<button class="more" if={ !fetching && next != null } onclick={ more } disabled={ moreFetching }><span if={ !moreFetching }>もっと</span><span if={ moreFetching }>読み込み中 <button class="more" if={ !fetching && next != null } onclick={ more } disabled={ moreFetching }>
<mk-ellipsis></mk-ellipsis></span></button> <span if={ !moreFetching }>もっと</span>
<span if={ moreFetching }>読み込み中<mk-ellipsis></mk-ellipsis></span></button>
<p class="no" if={ !fetching && users.length == 0 }>{ opts.noUsers }</p> <p class="no" if={ !fetching && users.length == 0 }>{ opts.noUsers }</p>
<p class="fetching" if={ fetching }><i class="fa fa-spinner fa-pulse fa-fw"></i>読み込んでいます <p class="fetching" if={ fetching }>
<mk-ellipsis></mk-ellipsis> <i class="fa fa-spinner fa-pulse fa-fw"></i>読み込んでいます<mk-ellipsis></mk-ellipsis>
</p> </p>
<style> <style>
:scope :scope
@ -100,7 +103,7 @@
this.update({ this.update({
moreFetching: true moreFetching: true
}); });
this.opts.fetch(this.mode == 'iknow', this.limit, this.cursor, obj => { this.opts.fetch(this.mode == 'iknow', this.limit, this.next, obj => {
this.update({ this.update({
moreFetching: false, moreFetching: false,
users: this.users.concat(obj.users), users: this.users.concat(obj.users),