feat: Load only upon consent
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
moanos [he/him] 2023-11-27 09:55:44 +01:00
parent 3ba24997a2
commit 2d0440c517
2 changed files with 55 additions and 52 deletions

View File

@ -8,7 +8,8 @@
</head>
<body>
<div class="include-mastodon-feed dark" id="fedi-feed">Loading...</div>
<div class="include-mastodon-feed dark" id="fedi-feed"></div>
<button onclick="activate()">Feed laden</button>
</body>
</html>

View File

@ -304,7 +304,9 @@ const mastodonFeedLoad = function(url, elementId, options) {
apiUrl = 'https://' + instance + '/api/v1/accounts/' + account_id + '/statuses';
window.addEventListener("load", () => {
function activate() {
mastodonFeedLoad(
apiUrl,
"fedi-feed",
@ -329,4 +331,4 @@ window.addEventListener("load", () => {
}
}
);
});
}