add more gtag for stop button

This commit is contained in:
geekgeekrun
2025-04-19 03:02:28 +08:00
parent 1d99cde602
commit 64e9d3068c
3 changed files with 13 additions and 1 deletions

View File

@@ -18,21 +18,25 @@ import { ref, onUnmounted, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import FlyingCompanyLogoList from '../../features/FlyingCompanyLogoList/index.vue'
import { ElMessage } from 'element-plus';
import { gtagRenderer } from '@renderer/utils/gtag'
const { ipcRenderer } = electron
const router = useRouter()
const handleStopButtonClick = async () => {
gtagRenderer('geek_auto_start_chat_with_boss_stop_button_clicked')
ipcRenderer.invoke('stop-geek-auto-start-chat-with-boss')
}
const isStopping = ref(false)
const handleStopping = () => {
gtagRenderer('geek_auto_start_chat_with_boss_become_stopping')
isStopping.value = true
}
ipcRenderer.once('geek-auto-start-chat-with-boss-stopping', handleStopping)
const handleStopped = () => {
gtagRenderer('geek_auto_start_chat_with_boss_become_stopped')
router.replace('/main-layout/GeekAutoStartChatWithBoss')
}
ipcRenderer.once('geek-auto-start-chat-with-boss-stopped', handleStopped)
@@ -47,12 +51,14 @@ onMounted(async () => {
await electron.ipcRenderer.invoke('run-geek-auto-start-chat-with-boss')
} catch (err) {
if (err instanceof Error && err.message.includes('NEED_TO_CHECK_RUNTIME_DEPENDENCIES')) {
gtagRenderer('geek_auto_start_chat_with_boss_cannot_run_due_to_corrupt')
ElMessage.error({
message: `核心组件损坏,正在尝试修复`
})
router.replace('/')
}
console.error(err)
gtagRenderer('geek_auto_start_chat_with_boss_cannot_run_due_to_unknown_error', { err })
}
})
</script>

View File

@@ -16,21 +16,25 @@ import { ref, onUnmounted, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import FlyingCompanyLogoList from '../../features/FlyingCompanyLogoList/index.vue'
import { ElMessage } from 'element-plus'
import { gtagRenderer } from '@renderer/utils/gtag'
const { ipcRenderer } = electron
const router = useRouter()
const handleStopButtonClick = async () => {
gtagRenderer('read_no_reply_reminder_stop_button_clicked')
ipcRenderer.invoke('stop-geek-auto-start-chat-with-boss')
}
const isStopping = ref(false)
const handleStopping = () => {
gtagRenderer('read_no_reply_reminder_become_stopping')
isStopping.value = true
}
ipcRenderer.once('geek-auto-start-chat-with-boss-stopping', handleStopping)
const handleStopped = () => {
gtagRenderer('read_no_reply_reminder_become_stopped')
router.replace('/main-layout/ReadNoReplyReminder')
}
ipcRenderer.once('geek-auto-start-chat-with-boss-stopped', handleStopped)
@@ -45,12 +49,14 @@ onMounted(async () => {
await electron.ipcRenderer.invoke('run-read-no-reply-auto-reminder')
} catch (err) {
if (err instanceof Error && err.message.includes('NEED_TO_CHECK_RUNTIME_DEPENDENCIES')) {
gtagRenderer('read_no_reply_reminder_cannot_run_due_to_corrupt')
ElMessage.error({
message: `核心组件损坏,正在尝试修复`
})
router.replace('/')
}
console.error(err)
gtagRenderer('read_no_reply_reminder_cannot_run_due_to_unknown_error', { err })
}
})
</script>

View File

@@ -351,7 +351,7 @@ const handleSubmit = async () => {
}
}
}
gtagRenderer('reminder_launched')
gtagRenderer('run_read_no_reply_reminder_launched')
router.replace({
path: '/geekAutoStartChatWithBoss/prepareRun',
query: { flow: 'read-no-reply-reminder' }