add option for users to opt out
All checks were successful
Code quality checks / biome (push) Successful in 7s
All checks were successful
Code quality checks / biome (push) Successful in 7s
This commit is contained in:
parent
ba67ba55e3
commit
5ad5d7181f
2 changed files with 14 additions and 0 deletions
|
@ -76,6 +76,7 @@ These can be defined in Lanyard's KV store to customize the page:
|
||||||
| `badges` | Enables badge fetching (`true` / `false`) |
|
| `badges` | Enables badge fetching (`true` / `false`) |
|
||||||
| `readme` | URL to a README displayed on the profile (`.md` or `.html`) |
|
| `readme` | URL to a README displayed on the profile (`.md` or `.html`) |
|
||||||
| `css` | URL to a css to change styles on the page, no import or require allowed |
|
| `css` | URL to a css to change styles on the page, no import or require allowed |
|
||||||
|
| `optout` | Allows users to stop sharing there profile on the website (`true` / `false`) |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -382,6 +382,19 @@ async function updatePresence(initialData) {
|
||||||
|
|
||||||
const kv = data.kv || {};
|
const kv = data.kv || {};
|
||||||
|
|
||||||
|
if (kv.optout === "true") {
|
||||||
|
const loadingOverlay = document.getElementById("loading-overlay");
|
||||||
|
if (loadingOverlay) {
|
||||||
|
loadingOverlay.innerHTML = `
|
||||||
|
<div class="error-message">
|
||||||
|
<p>This user has opted out of sharing their presence.</p>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
loadingOverlay.style.opacity = "1";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const cssLink = kv.css;
|
const cssLink = kv.css;
|
||||||
if (cssLink) {
|
if (cssLink) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue