Refactor logging and clean up unused console statements across multiple files
This commit is contained in:
parent
d6c7fde40c
commit
397cf28673
@ -54,7 +54,6 @@ test.beforeAll(async ({ browser }) => {
|
|||||||
// If no groups, these tests might not be able to proceed correctly.
|
// If no groups, these tests might not be able to proceed correctly.
|
||||||
// For now, we'll assume `groupNameForListTests` is somewhat valid or will be set.
|
// For now, we'll assume `groupNameForListTests` is somewhat valid or will be set.
|
||||||
}
|
}
|
||||||
console.log(`Using group: "${groupNameForListTests}" for list tests.`);
|
|
||||||
await page.close();
|
await page.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -308,16 +308,13 @@ const selectGroup = (group: Group) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const openCreateListDialog = (group: Group) => {
|
const openCreateListDialog = (group: Group) => {
|
||||||
console.log('Opening create list dialog for group:', group);
|
|
||||||
// Ensure we have the latest groups data
|
// Ensure we have the latest groups data
|
||||||
fetchGroups().then(() => {
|
fetchGroups().then(() => {
|
||||||
console.log('Setting up modal with group:', group);
|
|
||||||
availableGroupsForModal.value = [{
|
availableGroupsForModal.value = [{
|
||||||
label: group.name,
|
label: group.name,
|
||||||
value: group.id
|
value: group.id
|
||||||
}];
|
}];
|
||||||
showCreateListModal.value = true;
|
showCreateListModal.value = true;
|
||||||
console.log('Modal should be visible now:', showCreateListModal.value);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -59,15 +59,6 @@ const authStore = useAuthStore();
|
|||||||
const notificationStore = useNotificationStore();
|
const notificationStore = useNotificationStore();
|
||||||
const { t, locale, messages } = useI18n();
|
const { t, locale, messages } = useI18n();
|
||||||
|
|
||||||
// Debug output
|
|
||||||
console.log('=== i18n Debug Info ===');
|
|
||||||
console.log('Current locale:', locale.value);
|
|
||||||
console.log('Available messages:', messages.value);
|
|
||||||
console.log('English messages:', messages.value.en);
|
|
||||||
console.log('LoginPage messages:', messages.value.en?.loginPage);
|
|
||||||
console.log('Test translation:', t('loginPage.emailLabel'));
|
|
||||||
console.log('Test fallback:', t('message.hello'));
|
|
||||||
|
|
||||||
const email = ref('');
|
const email = ref('');
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const isPwdVisible = ref(false);
|
const isPwdVisible = ref(false);
|
||||||
|
@ -57,25 +57,20 @@ export const useAuthStore = defineStore('auth', () => {
|
|||||||
|
|
||||||
const fetchCurrentUser = async () => {
|
const fetchCurrentUser = async () => {
|
||||||
if (!accessToken.value) {
|
if (!accessToken.value) {
|
||||||
console.log('No access token found, clearing tokens')
|
|
||||||
clearTokens()
|
clearTokens()
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
console.log('Fetching current user profile...')
|
|
||||||
const response = await api.get(API_ENDPOINTS.USERS.PROFILE)
|
const response = await api.get(API_ENDPOINTS.USERS.PROFILE)
|
||||||
console.log('User profile fetched:', response.data)
|
|
||||||
setUser(response.data)
|
setUser(response.data)
|
||||||
return response.data
|
return response.data
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('AuthStore: Failed to fetch current user:', error)
|
|
||||||
clearTokens()
|
clearTokens()
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const login = async (email: string, password: string) => {
|
const login = async (email: string, password: string) => {
|
||||||
console.log('Attempting login...')
|
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('username', email)
|
formData.append('username', email)
|
||||||
formData.append('password', password)
|
formData.append('password', password)
|
||||||
@ -86,10 +81,8 @@ export const useAuthStore = defineStore('auth', () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('Login successful, setting tokens...')
|
|
||||||
const { access_token, refresh_token } = response.data
|
const { access_token, refresh_token } = response.data
|
||||||
setTokens({ access_token, refresh_token })
|
setTokens({ access_token, refresh_token })
|
||||||
// Fetch profile data after login
|
|
||||||
await fetchCurrentUser()
|
await fetchCurrentUser()
|
||||||
return response.data
|
return response.data
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,6 @@ export const useListDetailStore = defineStore('listDetail', {
|
|||||||
// Call the actual API endpoint using generic post method
|
// Call the actual API endpoint using generic post method
|
||||||
const endpoint = `/financials/expense_splits/${payload.expense_split_id}/settle`
|
const endpoint = `/financials/expense_splits/${payload.expense_split_id}/settle`
|
||||||
const response = await apiClient.post(endpoint, payload.activity_data)
|
const response = await apiClient.post(endpoint, payload.activity_data)
|
||||||
console.log('Settlement activity created:', response.data)
|
|
||||||
|
|
||||||
// Refresh list data to show updated statuses
|
// Refresh list data to show updated statuses
|
||||||
if (payload.list_id_for_refetch) {
|
if (payload.list_id_for_refetch) {
|
||||||
|
@ -33,7 +33,7 @@ const initializeSW = async () => {
|
|||||||
try {
|
try {
|
||||||
await self.skipWaiting();
|
await self.skipWaiting();
|
||||||
clientsClaim();
|
clientsClaim();
|
||||||
console.log('Service Worker initialized successfully');
|
// console.log('Service Worker initialized successfully');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error during service worker initialization:', error);
|
console.error('Error during service worker initialization:', error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user