From 85e67599af72b8002542a96189a6c5a16e3e4fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Wed, 16 Sep 2026 00:21:08 +0200 Subject: [PATCH] fix: multi-events --- polylan_submitter/src/Noita.vue | 14 +++- polylan_submitter/src/components/Results.vue | 48 ++++++------ polylan_submitter/src/stores/noita.ts | 79 ++++++++++---------- polylan_submitter/src/stores/user.ts | 7 +- 4 files changed, 78 insertions(+), 70 deletions(-) diff --git a/polylan_submitter/src/Noita.vue b/polylan_submitter/src/Noita.vue index 8783762..708070e 100644 --- a/polylan_submitter/src/Noita.vue +++ b/polylan_submitter/src/Noita.vue @@ -14,6 +14,12 @@ import { type SortingState, } from "@tanstack/vue-table"; +interface Props { + eventPath: string; +} + +const props = defineProps(); + const noitaStore = useNoitaStore(); const { userInfo, objectives, leaderboard, isLoadingLeaderboard, isUploading } = storeToRefs(noitaStore); @@ -135,7 +141,7 @@ const submitRun = async () => { if (uploadedFiles.value.length === 0) return; try { - await noitaStore.submitRun(uploadedFiles.value); + await noitaStore.submitRun(props.eventPath, uploadedFiles.value); uploadedFiles.value = []; alert("Run submitted successfully!"); } catch (error) { @@ -145,12 +151,12 @@ const submitRun = async () => { }; const goHome = () => { - window.location.href = "/"; + window.location.href = `/${props.eventPath}/`; }; const clearCache = async () => { try { - await noitaStore.clearCache(); + await noitaStore.clearCache(props.eventPath); alert("Cache cleared successfully!"); } catch (error) { console.error("Error clearing cache:", error); @@ -159,7 +165,7 @@ const clearCache = async () => { }; onMounted(() => { - noitaStore.loadUserData(); + noitaStore.loadUserData(props.eventPath); }); diff --git a/polylan_submitter/src/components/Results.vue b/polylan_submitter/src/components/Results.vue index 066ae7f..34a41c9 100644 --- a/polylan_submitter/src/components/Results.vue +++ b/polylan_submitter/src/components/Results.vue @@ -1,6 +1,10 @@