2018-06-02 13:34:53 +09:00
|
|
|
<template>
|
2018-09-18 05:35:06 +09:00
|
|
|
<mk-window ref="window" is-modal width="450px" height="500px" @closed="destroyDom">
|
2018-11-09 03:44:35 +09:00
|
|
|
<span slot="header"><fa :icon="['far', 'envelope']"/> {{ $t('title') }}</span>
|
2018-06-02 13:34:53 +09:00
|
|
|
|
2018-09-28 14:26:20 +09:00
|
|
|
<div class="slpqaxdoxhvglersgjukmvizkqbmbokc">
|
2018-06-02 15:51:43 +09:00
|
|
|
<div v-for="req in requests">
|
|
|
|
<router-link :key="req.id" :to="req.follower | userPage">{{ req.follower | userName }}</router-link>
|
|
|
|
<span>
|
2018-11-09 03:44:35 +09:00
|
|
|
<a @click="accept(req.follower)">{{ $t('accept') }}</a>|<a @click="reject(req.follower)">{{ $t('reject') }}</a>
|
2018-06-02 15:51:43 +09:00
|
|
|
</span>
|
|
|
|
</div>
|
2018-06-02 13:34:53 +09:00
|
|
|
</div>
|
|
|
|
</mk-window>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-11-09 03:44:35 +09:00
|
|
|
import i18n from '../../../i18n';
|
|
|
|
|
2018-06-02 13:34:53 +09:00
|
|
|
export default Vue.extend({
|
2018-11-09 03:44:35 +09:00
|
|
|
i18n: i18n('desktop/views/components/received-follow-requests-window.vue'),
|
2018-06-02 13:34:53 +09:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fetching: true,
|
|
|
|
requests: []
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
(this as any).api('following/requests/list').then(requests => {
|
|
|
|
this.fetching = false;
|
|
|
|
this.requests = requests;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
methods: {
|
2018-06-02 15:51:43 +09:00
|
|
|
accept(user) {
|
|
|
|
(this as any).api('following/requests/accept', { userId: user.id }).then(() => {
|
|
|
|
this.requests = this.requests.filter(r => r.follower.id != user.id);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
reject(user) {
|
|
|
|
(this as any).api('following/requests/reject', { userId: user.id }).then(() => {
|
|
|
|
this.requests = this.requests.filter(r => r.follower.id != user.id);
|
|
|
|
});
|
|
|
|
},
|
2018-06-02 13:34:53 +09:00
|
|
|
close() {
|
|
|
|
(this as any).$refs.window.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-09-28 15:34:34 +09:00
|
|
|
.slpqaxdoxhvglersgjukmvizkqbmbokc
|
2018-06-02 13:34:53 +09:00
|
|
|
padding 16px
|
|
|
|
|
|
|
|
> button
|
|
|
|
margin-bottom 16px
|
|
|
|
|
2018-06-02 15:51:43 +09:00
|
|
|
> div
|
|
|
|
display flex
|
2018-06-02 13:34:53 +09:00
|
|
|
padding 16px
|
2018-09-28 15:34:34 +09:00
|
|
|
border solid 1px var(--faceDivider)
|
2018-06-02 13:34:53 +09:00
|
|
|
border-radius 4px
|
|
|
|
|
2018-06-02 15:51:43 +09:00
|
|
|
> span
|
|
|
|
margin 0 0 0 auto
|
|
|
|
|
2018-06-02 13:34:53 +09:00
|
|
|
</style>
|