Fixes: 1) Correct missing semicolons in Pinia store definitions for cart, company, wishlist, and auth stores; 2) Refactor GraphQL queries to include fragments for improved modularity and readability; 3) Correct error handling in composables like `usePosts` and `useLanguages`; Extra: Enhanced App.vue to include dynamic company info and language fetching on mount; Added scoped styles for new components and pages.
42 lines
No EOL
975 B
JavaScript
42 lines
No EOL
975 B
JavaScript
import { ref } from 'vue';
|
|
|
|
export function useMailClient() {
|
|
const mailClientUrl = ref(null);
|
|
|
|
const mailClients = {
|
|
'gmail.com': 'https://mail.google.com/',
|
|
'outlook.com': 'https://outlook.live.com/',
|
|
'icloud.com': 'https://www.icloud.com/mail/',
|
|
'yahoo.com': 'https://mail.yahoo.com/',
|
|
'mail.ru': 'https://e.mail.ru/inbox/',
|
|
'yandex.ru': 'https://mail.yandex.ru/',
|
|
'proton.me': 'https://account.proton.me/mail',
|
|
'fastmail.com': 'https://fastmail.com/'
|
|
};
|
|
|
|
function detectMailClient(email) {
|
|
mailClientUrl.value = null;
|
|
|
|
if (!email) return;
|
|
|
|
const domain = email.split('@')[1];
|
|
|
|
Object.entries(mailClients).forEach((el) => {
|
|
if (domain === el[0]) mailClientUrl.value = el[1];
|
|
});
|
|
|
|
return mailClientUrl.value;
|
|
}
|
|
|
|
function openMailClient() {
|
|
if (mailClientUrl.value) {
|
|
window.open(mailClientUrl.value);
|
|
}
|
|
}
|
|
|
|
return {
|
|
mailClientUrl,
|
|
detectMailClient,
|
|
openMailClient
|
|
};
|
|
} |