Scamming banner

This commit is contained in:
rustdesk
2024-10-11 18:01:46 +08:00
parent 7db3e58c51
commit ec8e3854d0
4 changed files with 16 additions and 5 deletions

View File

@@ -4,7 +4,6 @@ import '../assets/styles/ccElegantBlack.css';
---
<!--<button type="button" class="cc-button">Show preferences modal</button>-->
<script>
import { run } from 'vanilla-cookieconsent';
import { config } from './CookieConsentConfig';
@@ -12,5 +11,15 @@ import '../assets/styles/ccElegantBlack.css';
// toggle custom black theme
document.body.classList.add('cc--elegant-black');
run(config);
function checkCookieConsent() {
// this cookie consent use cookie to store the consent status, but our webiste v2 use localStorage
// this is used to compliant with v2
const consentStatus = localStorage.getItem('cookie-accepted');
return consentStatus === 'true';
}
// If consent is not given, run the cookie consent config
if (!checkCookieConsent()) {
run(config);
}
</script>

View File

@@ -23,7 +23,9 @@ const Carousel = ({ list }) => {
delay: 2500,
disableOnInteraction: true,
}}
lazy={true}
// https://github.com/nolimits4web/swiper/blob/40a705e5bcadf2ee2ee90591ff9ed95c1aaf9026/src/swiper-element.mjs#L286
// workaround for {true} which cause console error
lazy='true'
scrollbar
modules={[Pagination, Autoplay, Scrollbar, Mousewheel]}
>