fix version filter for games, fix game header

This commit is contained in:
Trenton Zimmer
2026-09-12 12:19:48 -04:00
parent 90078b3540
commit 86d440ef1a
5 changed files with 9 additions and 11 deletions

View File

@@ -38,9 +38,7 @@ const props = defineProps({
function loadRoutes() {
const navigationData = [
{
label: `${
props.game.shortName ? props.game.shortName : props.game.name
} Home`,
label: "Game TOP",
icon: PhHouse,
path: `/games/${props.game.id}/`,
route: "game_page",

View File

@@ -102,7 +102,7 @@ async function loadProfile() {
}
if (data && !versionForm.currentVersion) {
versionForm.currentVersion = [...data.versions].sort().at(-1);
versionForm.currentVersion = Math.max(...data.versions);
}
} catch (error) {
console.error("Failed to fetch user profile data:", error);

View File

@@ -28,7 +28,7 @@ var gameID = null;
var thisGame = null;
const myProfile = ref(null);
const myVersions = ref(null);
const myVersions = ref([]);
const profiles = ref([]);
const hitchartData = ref(null);
const timeSensitiveData = ref([]);
@@ -43,8 +43,8 @@ const versionForm = reactive({
watch(
() => versionForm.currentVersion,
() => {
loadGame(versionForm.currentVersion, profiles.length != 0);
loadProfile();
loadGame(versionForm.currentVersion, profiles.length != 0);
musicIds.value = [];
},
);
@@ -99,7 +99,7 @@ async function loadProfile() {
myVersions.value = data.versions;
if (data && !versionForm.currentVersion) {
versionForm.currentVersion = [...data.versions].sort().at(-1);
versionForm.currentVersion = Math.max(...data.versions);
}
} catch (error) {
console.error("Failed to fetch user profile data:", error);

View File

@@ -103,7 +103,7 @@ async function loadProfile() {
myStats.value.timeline = baseTimeline;
if (data && !versionForm.currentVersion) {
versionForm.currentVersion = [...data.versions].sort().at(-1);
versionForm.currentVersion = Math.max(...data.versions);
}
if (data.hitChart?.length) {

View File

@@ -76,7 +76,7 @@ async function loadProfile() {
myVersions.value = data.versions;
if (data && !versionForm.currentVersion) {
versionForm.currentVersion = [...data.versions].sort().at(-1);
versionForm.currentVersion = Math.max(...data.versions);
}
if (thisGame.useActiveRival) {
@@ -242,7 +242,7 @@ async function deleteRival(otherUserId, type) {
async function setActive(type) {
var lastObject = myProfile.value?.last ?? {};
var rivalPosition = null;
var rivalPosition;
if (type.startsWith("friend_")) {
rivalPosition = parseInt(type.replace("friend_", ""), 10);
} else {
@@ -275,7 +275,7 @@ async function setActive(type) {
async function setInactive(type) {
var lastObject = myProfile.value?.last ?? {};
var rivalPosition = null;
var rivalPosition;
if (type.startsWith("friend_")) {
rivalPosition = parseInt(type.replace("friend_", ""), 10);