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.
|
||||
// For now, we'll assume `groupNameForListTests` is somewhat valid or will be set.
|
||||
}
|
||||
console.log(`Using group: "${groupNameForListTests}" for list tests.`);
|
||||
await page.close();
|
||||
});
|
||||
|
||||
|
@ -308,16 +308,13 @@ const selectGroup = (group: Group) => {
|
||||
};
|
||||
|
||||
const openCreateListDialog = (group: Group) => {
|
||||
console.log('Opening create list dialog for group:', group);
|
||||
// Ensure we have the latest groups data
|
||||
fetchGroups().then(() => {
|
||||
console.log('Setting up modal with group:', group);
|
||||
availableGroupsForModal.value = [{
|
||||
label: group.name,
|
||||
value: group.id
|
||||
}];
|
||||
showCreateListModal.value = true;
|
||||
console.log('Modal should be visible now:', showCreateListModal.value);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -59,15 +59,6 @@ const authStore = useAuthStore();
|
||||
const notificationStore = useNotificationStore();
|
||||
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 password = ref('');
|
||||
const isPwdVisible = ref(false);
|
||||
|
@ -57,25 +57,20 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
const fetchCurrentUser = async () => {
|
||||
if (!accessToken.value) {
|
||||
console.log('No access token found, clearing tokens')
|
||||
clearTokens()
|
||||
return null
|
||||
}
|
||||
try {
|
||||
console.log('Fetching current user profile...')
|
||||
const response = await api.get(API_ENDPOINTS.USERS.PROFILE)
|
||||
console.log('User profile fetched:', response.data)
|
||||
setUser(response.data)
|
||||
return response.data
|
||||
} catch (error: any) {
|
||||
console.error('AuthStore: Failed to fetch current user:', error)
|
||||
clearTokens()
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
const login = async (email: string, password: string) => {
|
||||
console.log('Attempting login...')
|
||||
const formData = new FormData()
|
||||
formData.append('username', email)
|
||||
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
|
||||
setTokens({ access_token, refresh_token })
|
||||
// Fetch profile data after login
|
||||
await fetchCurrentUser()
|
||||
return response.data
|
||||
}
|
||||
|
@ -70,7 +70,6 @@ export const useListDetailStore = defineStore('listDetail', {
|
||||
// Call the actual API endpoint using generic post method
|
||||
const endpoint = `/financials/expense_splits/${payload.expense_split_id}/settle`
|
||||
const response = await apiClient.post(endpoint, payload.activity_data)
|
||||
console.log('Settlement activity created:', response.data)
|
||||
|
||||
// Refresh list data to show updated statuses
|
||||
if (payload.list_id_for_refetch) {
|
||||
|
@ -33,7 +33,7 @@ const initializeSW = async () => {
|
||||
try {
|
||||
await self.skipWaiting();
|
||||
clientsClaim();
|
||||
console.log('Service Worker initialized successfully');
|
||||
// console.log('Service Worker initialized successfully');
|
||||
} catch (error) {
|
||||
console.error('Error during service worker initialization:', error);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user