Skip to content

Commit

Permalink
fix: fixed success created org modal
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiantela committed Sep 29, 2023
1 parent 40dd2e8 commit 9566b15
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
18 changes: 10 additions & 8 deletions src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
</div>

<div v-else class="app">
<pos-register
v-if="showPosRegister"
@success="isModalCreatedProjectOpen = true"
/>
<pos-register v-if="showPosRegister" />

<template v-else>
<div>
Expand Down Expand Up @@ -133,7 +130,7 @@ import RightBar from './components/common/RightBar/Index.vue';
import TrialPeriod from './modals/TrialPeriod.vue';
import { setUser } from '@sentry/browser';
import projects from './api/projects';
import WarningVerifyMail from './components/WarningVerifyMail.vue';
// import WarningVerifyMail from './components/WarningVerifyMail.vue';
import PosRegister from './views/register/index.vue';
import ModalRegistered from './views/register/ModalRegistered.vue';
Expand All @@ -155,7 +152,7 @@ export default {
ApiOptions,
RightBar,
TrialPeriod,
WarningVerifyMail,
// WarningVerifyMail,
PosRegister,
ModalRegistered,
},
Expand Down Expand Up @@ -201,8 +198,9 @@ export default {
showPosRegister() {
return (
this.$store.state.Account.profile &&
!this.$store.state.Account.profile?.last_update_profile
(this.$store.state.Account.profile &&
!this.$store.state.Account.profile?.last_update_profile) ||
this.$route.name === 'DevelopmentRegister'
);
},
Expand Down Expand Up @@ -256,6 +254,10 @@ export default {
'background: #00DED2; color: #262626',
);
window.addEventListener('openModalAddedFirstInfos', () => {
this.isModalCreatedProjectOpen = true;
});
window.addEventListener('message', (event) => {
const prefix = 'connect:';
const content = String(event.data);
Expand Down
2 changes: 1 addition & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const routes = [
},
{
path: '/development/register',
component: Register,
name: 'DevelopmentRegister',
meta: {
requiresAuth: true,
title: 'pages.settings',
Expand Down
13 changes: 7 additions & 6 deletions src/store/account/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ export default {
}
},

async updateProfile({ commit }, data) {
async updateProfile({ commit, state }, data) {
try {
commit('UPDATE_PROFILE_REQUEST');
const response = await account.updateProfile(data);
commit('UPDATE_PROFILE_SUCCESS', response.data);
commit('UPDATE_PROFILE_SUCCESS', {
...response.data,
last_update_profile: state.profile.last_update_profile,
});
} catch (e) {
commit('UPDATE_PROFILE_ERROR', e);
}
Expand Down Expand Up @@ -81,10 +84,8 @@ export default {
const {
data: { user: userResponse },
} = await account.addInitialData({ company, user });
commit(
'UPDATE_PROFILE_INITIAL_INFO_SUCCESS',
userResponse.last_update_profile,
);

return userResponse;
} catch (error) {
commit('UPDATE_PROFILE_INITIAL_INFO_ERROR', error);
throw error;
Expand Down
2 changes: 1 addition & 1 deletion src/views/register/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export default {
this.$refs.modalCreatingProject.onCloseClick();
this.$emit('success');
window.dispatchEvent(new CustomEvent('openModalAddedFirstInfos'));
this.$store.commit('UPDATE_PROFILE_INITIAL_INFO_SUCCESS', 'now()');
},
Expand Down

0 comments on commit 9566b15

Please sign in to comment.