close sesion question added
This commit is contained in:
@@ -6,16 +6,28 @@
|
||||
import {getTypeCompany} from '../helpers/type_company'
|
||||
import {getDateMonthDay} from '../helpers/date_formats'
|
||||
import EditCompanyModal from '../components/ui/EditCompanyModal.vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
const auth = useAuthStore()
|
||||
const company = useCompanyStore();
|
||||
const { user, authStatus } = storeToRefs(auth);
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getInitialData()
|
||||
if(user.value) {
|
||||
getInitialData()
|
||||
}
|
||||
});
|
||||
|
||||
watch(user, () => {
|
||||
if(user.value) {
|
||||
getInitialData();
|
||||
}
|
||||
})
|
||||
|
||||
const getInitialData = async() => {
|
||||
await auth.authenticationPromise;
|
||||
// await authenticationPromise;
|
||||
await company.getCompanyData();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user