add more console.debug
Main daploy / deploy (push) Successful in 43s

This commit is contained in:
2024-12-02 14:32:14 +02:00
parent 04d42e4fef
commit 5ef8901cd5
@@ -99,6 +99,7 @@ async function requestNotificationPermission() {
const subscription = await registration.pushManager
.subscribe(await subscribeOptionsPromise)
.catch(async (error) => {
console.debug('subscribe error', error)
const oldSubscription = await registration.pushManager.getSubscription()
if (!oldSubscription) {
throw error
@@ -150,7 +151,7 @@ const stage = ref<'receivePushSubscription' | 'createPushSubscription' | 'remove
const { isPending, isError, error, mutate } = useMutation({
mutationKey: [stage],
mutationFn: async () => {
console.debug(stage.value)
console.debug('stage', stage.value)
try {
if (stage.value === 'receivePushSubscription') {
const chatSettingsDocument = await getUserChatSettingsDocument({
@@ -158,8 +159,15 @@ const { isPending, isError, error, mutate } = useMutation({
chat,
user_chat_role,
}).catch((error) => {
if (!isNotFoundError(error)) throw error
if (!isNotFoundError(error)) {
console.debug('chatSettingsDocument error not found - its ok', error)
throw error
}
console.debug('chatSettingsDocument error', error)
})
if (chatSettingsDocument) {
console.debug('chatSettingsDocument', chatSettingsDocument)
}
if (
(chatSettingsDocument && chatSettingsDocument.is_push_notification_enabled) ||
(!chatSettingsDocument &&
@@ -203,6 +211,7 @@ const { isPending, isError, error, mutate } = useMutation({
}
} catch (error) {
enabled.value = false
console.debug('unknown error at stage ', stage.value, error)
throw error
}
return null