update deps (MisskeyIO#950)

This commit is contained in:
あわわわとーにゅ 2025-03-31 08:05:23 +09:00 committed by GitHub
parent b85f6e9b75
commit 60684568e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 3418 additions and 3463 deletions

View file

@ -110,7 +110,8 @@ import { unisonReload } from '@/scripts/unison-reload.js';
import { miLocalStorage } from '@/local-storage.js';
import { instance } from '@/instance.js';
import { host } from '@/config.js';
import { GtagConsent, GtagConsentParams } from 'vue-gtag';
import { consent as gtagConsent } from 'vue-gtag';
import type { GtagConsentParams } from '@/types/gtag.js';
const $i = signinRequired();
@ -137,18 +138,17 @@ const gaConsent = computed({
gaConsentInternal.value = value;
},
});
const gtagConsentInternal = ref(
(miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams) ?? {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
functionality_storage: 'denied',
personalization_storage: 'denied',
security_storage: 'granted',
},
);
const gtagConsent = computed({
const gtagConsentInternal = ref({
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
functionality_storage: 'denied',
personalization_storage: 'denied',
security_storage: 'granted',
...(miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams),
});
const gtagConsentParams = computed({
get: () => gtagConsentInternal.value,
set: (value: GtagConsentParams) => {
miLocalStorage.setItemAsJson('gtagConsent', value);
@ -156,10 +156,10 @@ const gtagConsent = computed({
},
});
const gtagConsentAnalytics = computed({
get: () => gtagConsent.value.analytics_storage === 'granted',
get: () => gtagConsentParams.value.analytics_storage === 'granted',
set: (value: boolean) => {
gtagConsent.value = {
...gtagConsent.value,
gtagConsentParams.value = {
...gtagConsentParams.value,
ad_storage: value ? 'granted' : 'denied',
ad_user_data: value ? 'granted' : 'denied',
analytics_storage: value ? 'granted' : 'denied',
@ -167,19 +167,19 @@ const gtagConsentAnalytics = computed({
},
});
const gtagConsentFunctionality = computed({
get: () => gtagConsent.value.functionality_storage === 'granted',
get: () => gtagConsentParams.value.functionality_storage === 'granted',
set: (value: boolean) => {
gtagConsent.value = {
...gtagConsent.value,
gtagConsentParams.value = {
...gtagConsentParams.value,
functionality_storage: value ? 'granted' : 'denied',
};
},
});
const gtagConsentPersonalization = computed({
get: () => gtagConsent.value.personalization_storage === 'granted',
get: () => gtagConsentParams.value.personalization_storage === 'granted',
set: (value: boolean) => {
gtagConsent.value = {
...gtagConsent.value,
gtagConsentParams.value = {
...gtagConsentParams.value,
ad_personalization: value ? 'granted' : 'denied',
personalization_storage: value ? 'granted' : 'denied',
};
@ -200,8 +200,8 @@ watch(gaConsent, async () => {
await reloadAsk();
});
watch(gtagConsent, async () => {
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent.value);
watch(gtagConsentParams, async () => {
gtagConsent('update', gtagConsentParams.value as GtagConsentParams);
});
function save() {