forked from potsda.mn/mobilizon
Refresh loggeduser information before the final step of onboarding
Otherwise we endup in a loop Closes #964 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
21325a014d
commit
3fb0265d2d
|
@ -272,6 +272,11 @@ export default class NavBar extends Vue {
|
|||
// If we don't have any identities, the user has validated their account,
|
||||
// is logging for the first time but didn't create an identity somehow
|
||||
if (this.identities.length === 0) {
|
||||
console.debug(
|
||||
"We have no identities listed for current user",
|
||||
this.identities
|
||||
);
|
||||
console.debug("Pushing route to REGISTER_PROFILE");
|
||||
try {
|
||||
await this.$router.push({
|
||||
name: RouteName.REGISTER_PROFILE,
|
||||
|
|
|
@ -406,7 +406,6 @@ import Subtitle from "../components/Utils/Subtitle.vue";
|
|||
DateComponent,
|
||||
EventParticipationCard,
|
||||
MultiCard,
|
||||
"settings-onboard": () => import("./User/SettingsOnboard.vue"),
|
||||
},
|
||||
metaInfo() {
|
||||
return {
|
||||
|
@ -569,7 +568,9 @@ export default class Home extends Vue {
|
|||
|
||||
@Watch("loggedUser")
|
||||
detectEmptyUserSettings(loggedUser: IUser): void {
|
||||
console.debug("Try to detect empty user settings", loggedUser);
|
||||
if (loggedUser?.id && loggedUser?.settings === null) {
|
||||
console.debug("No user settings, pushing to onboarding assistant");
|
||||
this.$router.push({
|
||||
name: RouteName.WELCOME_SCREEN,
|
||||
params: { step: "1" },
|
||||
|
|
|
@ -49,7 +49,8 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue } from "vue-property-decorator";
|
||||
import { USER_SETTINGS } from "@/graphql/user";
|
||||
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
||||
import { TIMEZONES } from "../../graphql/config";
|
||||
import RouteName from "../../router/name";
|
||||
import { IConfig } from "../../types/config.model";
|
||||
|
@ -65,6 +66,7 @@ import { IConfig } from "../../types/config.model";
|
|||
},
|
||||
apollo: {
|
||||
config: TIMEZONES,
|
||||
loggedUser: USER_SETTINGS,
|
||||
},
|
||||
metaInfo() {
|
||||
return {
|
||||
|
@ -82,6 +84,11 @@ export default class SettingsOnboard extends Vue {
|
|||
get stepIndex(): number {
|
||||
return this.step - 1;
|
||||
}
|
||||
|
||||
@Watch("stepIndex")
|
||||
refetchUserSettings() {
|
||||
this.$apollo.queries.loggedUser.refetch();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
|
Loading…
Reference in a new issue