Merge branch 'develop' of https://github.com/syuilo/misskey into develop

This commit is contained in:
syuilo 2018-12-13 01:18:29 +09:00
commit 656cec65b9
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
1 changed files with 15 additions and 4 deletions

View File

@ -1,22 +1,22 @@
<template> <template>
<ui-card> <ui-card v-if="enableTwitterIntegration || enableDiscordIntegration || enableGithubIntegration">
<div slot="title"><fa icon="share-alt"/> {{ $t('title') }}</div> <div slot="title"><fa icon="share-alt"/> {{ $t('title') }}</div>
<section> <section v-if="enableTwitterIntegration">
<header><fa :icon="['fab', 'twitter']"/> Twitter</header> <header><fa :icon="['fab', 'twitter']"/> Twitter</header>
<p v-if="$store.state.i.twitter">{{ $t('connected-to') }}: <a :href="`https://twitter.com/${$store.state.i.twitter.screenName}`" target="_blank">@{{ $store.state.i.twitter.screenName }}</a></p> <p v-if="$store.state.i.twitter">{{ $t('connected-to') }}: <a :href="`https://twitter.com/${$store.state.i.twitter.screenName}`" target="_blank">@{{ $store.state.i.twitter.screenName }}</a></p>
<ui-button v-if="$store.state.i.twitter" @click="disconnectTwitter">{{ $t('disconnect') }}</ui-button> <ui-button v-if="$store.state.i.twitter" @click="disconnectTwitter">{{ $t('disconnect') }}</ui-button>
<ui-button v-else @click="connectTwitter">{{ $t('connect') }}</ui-button> <ui-button v-else @click="connectTwitter">{{ $t('connect') }}</ui-button>
</section> </section>
<section> <section v-if="enableDiscordIntegration">
<header><fa :icon="['fab', 'discord']"/> Discord</header> <header><fa :icon="['fab', 'discord']"/> Discord</header>
<p v-if="$store.state.i.discord">{{ $t('connected-to') }}: <a :href="`https://discordapp.com/users/${$store.state.i.discord.id}`" target="_blank">@{{ $store.state.i.discord.username }}#{{ $store.state.i.discord.discriminator }}</a></p> <p v-if="$store.state.i.discord">{{ $t('connected-to') }}: <a :href="`https://discordapp.com/users/${$store.state.i.discord.id}`" target="_blank">@{{ $store.state.i.discord.username }}#{{ $store.state.i.discord.discriminator }}</a></p>
<ui-button v-if="$store.state.i.discord" @click="disconnectDiscord">{{ $t('disconnect') }}</ui-button> <ui-button v-if="$store.state.i.discord" @click="disconnectDiscord">{{ $t('disconnect') }}</ui-button>
<ui-button v-else @click="connectDiscord">{{ $t('connect') }}</ui-button> <ui-button v-else @click="connectDiscord">{{ $t('connect') }}</ui-button>
</section> </section>
<section> <section v-if="enableGithubIntegration">
<header><fa :icon="['fab', 'github']"/> GitHub</header> <header><fa :icon="['fab', 'github']"/> GitHub</header>
<p v-if="$store.state.i.github">{{ $t('connected-to') }}: <a :href="`https://github.com/${$store.state.i.github.login}`" target="_blank">@{{ $store.state.i.github.login }}</a></p> <p v-if="$store.state.i.github">{{ $t('connected-to') }}: <a :href="`https://github.com/${$store.state.i.github.login}`" target="_blank">@{{ $store.state.i.github.login }}</a></p>
<ui-button v-if="$store.state.i.github" @click="disconnectGithub">{{ $t('disconnect') }}</ui-button> <ui-button v-if="$store.state.i.github" @click="disconnectGithub">{{ $t('disconnect') }}</ui-button>
@ -39,9 +39,20 @@ export default Vue.extend({
twitterForm: null, twitterForm: null,
discordForm: null, discordForm: null,
githubForm: null, githubForm: null,
enableTwitterIntegration: false,
enableDiscordIntegration: false,
enableGithubIntegration: false,
}; };
}, },
created() {
this.$root.getMeta().then(meta => {
this.enableTwitterIntegration = meta.enableTwitterIntegration;
this.enableDiscordIntegration = meta.enableDiscordIntegration;
this.enableGithubIntegration = meta.enableGithubIntegration;
});
},
mounted() { mounted() {
document.cookie = `i=${this.$store.state.i.token}`; document.cookie = `i=${this.$store.state.i.token}`;
this.$watch('$store.state.i', () => { this.$watch('$store.state.i', () => {