2020-11-06 11:34:32 +01:00
|
|
|
<template>
|
|
|
|
<redirect-with-account
|
2021-01-15 16:55:58 +01:00
|
|
|
v-if="uri"
|
2020-11-06 11:34:32 +01:00
|
|
|
:uri="uri"
|
|
|
|
:pathAfterLogin="`/@${preferredUsername}`"
|
|
|
|
:sentence="sentence"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
|
|
import RedirectWithAccount from "@/components/Utils/RedirectWithAccount.vue";
|
2021-01-15 16:55:58 +01:00
|
|
|
import { FETCH_GROUP } from "@/graphql/group";
|
|
|
|
import { IGroup } from "@/types/actor";
|
2020-11-06 11:34:32 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
components: { RedirectWithAccount },
|
2021-01-15 16:55:58 +01:00
|
|
|
apollo: {
|
|
|
|
group: {
|
|
|
|
query: FETCH_GROUP,
|
|
|
|
fetchPolicy: "cache-and-network",
|
|
|
|
variables() {
|
|
|
|
return {
|
|
|
|
name: this.$route.params.preferredUsername,
|
|
|
|
beforeDateTime: null,
|
|
|
|
afterDateTime: new Date(),
|
|
|
|
};
|
|
|
|
},
|
|
|
|
skip() {
|
|
|
|
return !this.$route.params.preferredUsername;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-11-06 11:34:32 +01:00
|
|
|
})
|
|
|
|
export default class JoinGroupWithAccount extends Vue {
|
|
|
|
@Prop({ type: String, required: true }) preferredUsername!: string;
|
|
|
|
|
2021-01-15 16:55:58 +01:00
|
|
|
group!: IGroup;
|
|
|
|
|
2020-11-06 11:34:32 +01:00
|
|
|
get uri(): string {
|
2021-01-15 16:55:58 +01:00
|
|
|
return this.group?.url;
|
2020-11-06 11:34:32 +01:00
|
|
|
}
|
|
|
|
|
2020-11-30 10:24:11 +01:00
|
|
|
sentence = this.$t(
|
|
|
|
"We will redirect you to your instance in order to interact with this group"
|
|
|
|
);
|
2020-11-06 11:34:32 +01:00
|
|
|
}
|
|
|
|
</script>
|