Fix optimistic update when unfollowing a relay

This commit is contained in:
Angelina Filippova 2020-08-19 01:02:56 +03:00
parent 7e72078f29
commit 0a146aef7f
3 changed files with 5 additions and 4 deletions

View file

@ -150,7 +150,8 @@ export default {
draft: 'Draft',
delete: 'Delete',
cancel: 'Cancel',
confirm: 'Confirm'
confirm: 'Confirm',
unfollow: 'Unfollow'
},
errorLog: {
tips: 'Please click the bug icon in the upper right corner',

View file

@ -16,7 +16,7 @@ const relays = {
state.fetchedRelays = [...state.fetchedRelays, { actor: relay }]
},
DELETE_RELAY: (state, relay) => {
state.fetchedRelays = state.fetchedRelays.filter(fetchedRelay => fetchedRelay !== relay)
state.fetchedRelays = state.fetchedRelays.filter(fetchedRelay => fetchedRelay.actor !== relay)
}
},
actions: {

View file

@ -2,7 +2,7 @@
<div v-if="!loading" class="relays-container">
<div class="follow-relay-container">
<el-input v-model="newRelay" :placeholder="$t('settings.followRelay')" class="follow-relay" @keyup.enter.native="followRelay"/>
<el-button type="primary" @click.native="followRelay">{{ $t('settings.follow') }}</el-button>
<el-button @click.native="followRelay">{{ $t('settings.follow') }}</el-button>
</div>
<el-table :data="relays">
<el-table-column
@ -23,7 +23,7 @@
type="text"
size="small"
@click.native="deleteRelay(scope.row.actor)">
{{ $t('table.delete') }}
{{ $t('table.unfollow') }}
</el-button>
</template>
</el-table-column>