From 37a64d59a2be5a98e1a8dee8c8ce022d944cdd06 Mon Sep 17 00:00:00 2001 From: Russell2259 Date: Tue, 9 Jan 2024 15:42:56 +0000 Subject: [PATCH] fix featured game --- static/assets/JSON/games.json | 2 +- static/assets/js/main.js | 4 ++-- static/assets/js/settings.js | 6 ------ templates/discord_widget.html | 5 ++++- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/static/assets/JSON/games.json b/static/assets/JSON/games.json index ac63afb..b50ae8e 100644 --- a/static/assets/JSON/games.json +++ b/static/assets/JSON/games.json @@ -210,7 +210,7 @@ "image": "/assets/img/dmd.jpg" }, { - "name": "Fortnite [USE TOUCHSCREEN]", + "name": "Fortnite", "target": "https://now.gg/play/epic-games/7308/fortnite", "image": "https://upload.wikimedia.org/wikipedia/commons/7/7c/Fortnite_F_lettermark_logo.png", "popular": true diff --git a/static/assets/js/main.js b/static/assets/js/main.js index d78c011..c67a233 100644 --- a/static/assets/js/main.js +++ b/static/assets/js/main.js @@ -48,11 +48,11 @@ if (window.self === window.top && location.pathname !== '/view') setTimeout(asyn }, 500); if (location.pathname === '/') { - fetch('/assets/JSON/games.json') + fetch('/api/games') .then(res => res.json()) .then(games => { const gameName = 'Fortnite'; - const game = games.filter(g => g.name === gameName)[0]; + const game = games.all.filter(g => g.name === gameName)[0]; document.querySelector('.featured').addEventListener('click', () => { if (isValidURL(game.target)) createViewPage({ diff --git a/static/assets/js/settings.js b/static/assets/js/settings.js index 642fc91..b92b4ab 100644 --- a/static/assets/js/settings.js +++ b/static/assets/js/settings.js @@ -57,8 +57,6 @@ class Settings { if (navigator.userAgent.includes('Firefox')) document.querySelector('#export_error').innerHTML = 'Your browser does not fully support this feature. Some data may not export.

'; document.querySelector('#export').addEventListener('click', () => { - //Still in beta - //if (false) { const CryptoJSScript = document.createElement('script'); CryptoJSScript.src = 'https://unpkg.com/crypto-js@latest/crypto-js.js'; document.body.appendChild(CryptoJSScript); @@ -136,12 +134,9 @@ class Settings { if (i + 1 === Object.keys(cookie.all()).length) exportEvents.emit('cookies'); } else exportEvents.emit('cookies'); }); - //} }); document.querySelector('#import').addEventListener('click', () => { - //Still in beta - //if (false) { const CryptoJSScript = document.createElement('script'); CryptoJSScript.src = 'https://unpkg.com/crypto-js@latest/crypto-js.js'; document.body.appendChild(CryptoJSScript); @@ -216,7 +211,6 @@ class Settings { reader.readAsText(file); }); }); - //} }); fetch('/assets/JSON/cloaks.json').then(res => res.json()).then(cloaks => { diff --git a/templates/discord_widget.html b/templates/discord_widget.html index bc864c0..938c07d 100644 --- a/templates/discord_widget.html +++ b/templates/discord_widget.html @@ -1,6 +1,9 @@ + \ No newline at end of file