This commit is contained in:
D. Seifert 2025-03-27 18:19:29 +08:00
parent 3a202eeb3d
commit 7f002c06f0
2 changed files with 4 additions and 2 deletions

View File

@ -12,8 +12,7 @@ import { HistoryItem } from './HistoryItem';
import { binDates } from './date-binning';
import { useSearchFilter } from '~/lib/hooks/useSearchFilter';
import { SaveProblem } from './SaveProblem';
import { useAdminStatus } from '~/lib/stores/user';
import { authStatusStore } from '../../lib/stores/auth';
import { authStatusStore } from '~/lib/stores/auth';
import { useStore } from '@nanostores/react';
const menuVariants = {

View File

@ -95,6 +95,7 @@ function getReproductionData(): any | null {
} catch (error: any) {
console.error('Error getting reproduction data', error?.stack || error);
toast.error(`Error getting reproduction data: ${error?.message}`);
return null;
}
}
@ -125,6 +126,7 @@ export function SaveProblem() {
e.stopPropagation();
const currentReproData = getReproductionData();
if (!currentReproData) {
return;
}
@ -153,6 +155,7 @@ export function SaveProblem() {
}
const newProblemId = await saveProblem(formData.title, formData.description, formData.username, reproData);
if (newProblemId) {
setProblemId(newProblemId);
}