fix: multi-events
This commit is contained in:
@@ -14,6 +14,12 @@ import {
|
||||
type SortingState,
|
||||
} from "@tanstack/vue-table";
|
||||
|
||||
interface Props {
|
||||
eventPath: string;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
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);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user