updated nav, colors and layout

This commit is contained in:
cnachtigall1991
2021-10-06 22:53:49 +02:00
parent a62a702484
commit a42c3ff777
6 changed files with 102 additions and 23 deletions

View File

@@ -71,13 +71,26 @@ export const GetHLTV_1 = (kills = 0, rounds, deaths = 0, k2 = 0, k3 = 0, k4 = 0,
export const SaveLastVisitedToLocalStorage = (data) => {
let a = JSON.parse(localStorage.getItem('recent-visited')) || [];
if (a.length === 0) {
a.push(data);
} else if (a.find(p => p.steamid64 === data.steamid64)) {
a.splice(a.findIndex(j => j.steamid64 === data.steamid64), 1)
a.push(data)
} else if (!a.find(p => p.steamid64 === data.steamid64)) {
a.push(data)
} else if (a.length === 9) {
if (a.find(p => p.steamid64 === data.steamid64)) {
a.shift()
a.splice(a.findIndex(i => i.steamid64 === data.steamid64), 1)
a.push(data)
} else if (!a.find(p => p.steamid64 === data.steamid64)) {
a.shift()
a.push(data)
}
} else if (a.length > 0 && a.length < 9) {
if (a.find(p => p.steamid64 === data.steamid64)) {
a.splice(a.findIndex(i => i.steamid64 === data.steamid64), 1)
a.push(data)
} else if (!a.find(p => p.steamid64 === data.steamid64)) {
a.push(data)
}
}
localStorage.setItem('recent-visited', JSON.stringify(a));
}