Skip to content

Add: policies consent for google - #31

Merged
PIKACHUIM merged 2 commits into
mainfrom
policies
Jun 24, 2025
Merged

PIKACHUIM merged 2 commits into
mainfrom
policies

Conversation

@jyxjjj

@jyxjjj jyxjjj commented Jun 24, 2025

Copy link
Copy Markdown
Member

Google Verification

@jyxjjj
jyxjjj requested review from PIKACHUIM and Copilot June 24, 2025 02:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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") {

Comment thread public/index.html
</div>

<!-- Google Privacy Consent Modal -->
<div id="google-consent-modal" class="modal">

Copilot AI Jun 24, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<div id="google-consent-modal" class="modal">
<div id="google-consent-modal" class="google-consent-modal">

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +14
const acceptGoogleConsent = closeGoogleConsentModal = () => {
// 关闭 Google 隐私政策和使用条款弹窗
const modal = document.getElementById('google-consent-modal');
if (modal) {
modal.style.display = 'none';
}
}

Copilot AI Jun 24, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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;

Copilot uses AI. Check for mistakes.
@jyxjjj

jyxjjj commented Jun 24, 2025

Copy link
Copy Markdown
Member Author

AI说的好像有点道理 我中间改了一次去掉了x号 强制同意 css是最后加的 你们看着改下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants