feat: let platforms disable we are using cookies prompt
This commit is contained in:
@@ -73,6 +73,7 @@ import { applySetting } from "~/newstore/settings"
|
|||||||
import { getLocalConfig, setLocalConfig } from "~/newstore/localpersistence"
|
import { getLocalConfig, setLocalConfig } from "~/newstore/localpersistence"
|
||||||
import { useToast } from "~/composables/toast"
|
import { useToast } from "~/composables/toast"
|
||||||
import { useI18n } from "~/composables/i18n"
|
import { useI18n } from "~/composables/i18n"
|
||||||
|
import { platform } from "~/platform"
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@@ -98,7 +99,10 @@ onBeforeMount(() => {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const cookiesAllowed = getLocalConfig("cookiesAllowed") === "yes"
|
const cookiesAllowed = getLocalConfig("cookiesAllowed") === "yes"
|
||||||
if (!cookiesAllowed) {
|
const platformAllowsCookiePrompts =
|
||||||
|
platform.platformFeatureFlags.promptAsUsingCookies ?? true
|
||||||
|
|
||||||
|
if (!cookiesAllowed && platformAllowsCookiePrompts) {
|
||||||
toast.show(`${t("app.we_use_cookies")}`, {
|
toast.show(`${t("app.we_use_cookies")}`, {
|
||||||
duration: 0,
|
duration: 0,
|
||||||
action: [
|
action: [
|
||||||
|
|||||||
@@ -35,6 +35,14 @@ export type PlatformDef = {
|
|||||||
* If a value is not given, then the value is assumed to be false
|
* If a value is not given, then the value is assumed to be false
|
||||||
*/
|
*/
|
||||||
cookiesEnabled?: boolean
|
cookiesEnabled?: boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the platform should prompt the user that cookies are being used.
|
||||||
|
* This will result in the user being notified a cookies advisory and is meant for web apps.
|
||||||
|
*
|
||||||
|
* If a value is not given, then the value is assumed to be true
|
||||||
|
*/
|
||||||
|
promptAsUsingCookies?: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ createHoppApp("#app", {
|
|||||||
exportAsGIST: false,
|
exportAsGIST: false,
|
||||||
hasTelemetry: false,
|
hasTelemetry: false,
|
||||||
cookiesEnabled: true,
|
cookiesEnabled: true,
|
||||||
|
promptAsUsingCookies: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user