Repository navigation
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a Google privacy consent modal that appears when selecting the Google driver, adds its styling and behavior, and removes some unused imports in the backend.
- Removed unused imports from
src/index.ts - Added modal markup and consent scripts/styles for Google in frontend
- Wired up the consent display logic in the event handler
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Cleaned up unused imports |
| public/static/style.css | Added styles for the Google consent modal |
| public/static/googleconsent.js | Implemented show/hide functions for the consent modal |
| public/static/event.js | Triggers the consent modal when Google driver is chosen |
| public/index.html | Inserted consent modal HTML and script include |
Comments suppressed due to low confidence (1)
public/static/event.js:96
- Consider adding unit or integration tests to verify that selecting the Google driver triggers
showGoogleConsent()and that accepting the consent hides the modal.
if (driver_txt_input.value === "googleui_go") {
| </div> | ||
|
|
||
| <!-- Google Privacy Consent Modal --> | ||
| <div id="google-consent-modal" class="modal"> |
There was a problem hiding this comment.
The CSS rules target .google-consent-modal but the element uses class modal. Update the element’s class to google-consent-modal or adjust the CSS selector to match #google-consent-modal.
| <div id="google-consent-modal" class="modal"> | |
| <div id="google-consent-modal" class="google-consent-modal"> |
| const acceptGoogleConsent = closeGoogleConsentModal = () => { | ||
| // 关闭 Google 隐私政策和使用条款弹窗 | ||
| const modal = document.getElementById('google-consent-modal'); | ||
| if (modal) { | ||
| modal.style.display = 'none'; | ||
| } | ||
| } |
There was a problem hiding this comment.
Chained assignment here creates an implicit global closeGoogleConsentModal and may fail under strict mode. Declare closeGoogleConsentModal (e.g. const closeGoogleConsentModal = () => { ... }) or separate the assignments properly.
| const acceptGoogleConsent = closeGoogleConsentModal = () => { | |
| // 关闭 Google 隐私政策和使用条款弹窗 | |
| const modal = document.getElementById('google-consent-modal'); | |
| if (modal) { | |
| modal.style.display = 'none'; | |
| } | |
| } | |
| const closeGoogleConsentModal = () => { | |
| // 关闭 Google 隐私政策和使用条款弹窗 | |
| const modal = document.getElementById('google-consent-modal'); | |
| if (modal) { | |
| modal.style.display = 'none'; | |
| } | |
| } | |
| const acceptGoogleConsent = closeGoogleConsentModal; |
|
AI说的好像有点道理 我中间改了一次去掉了x号 强制同意 css是最后加的 你们看着改下 |
Google Verification