Fix
This commit is contained in:
14
src/App.tsx
14
src/App.tsx
@@ -16,12 +16,14 @@ const App = () => {
|
||||
drawer: { width: 300, depth: 400, height: 80 },
|
||||
wallThickness: 1.2,
|
||||
printerTolerance: 0.5,
|
||||
cornerRadius: 4, // <--- Дефолтное скругление (4мм)
|
||||
cornerRadius: 4,
|
||||
});
|
||||
|
||||
// ИСПРАВЛЕНИЕ: Добавлено поле subdivisions
|
||||
const [splits, setSplits] = useState<LayoutSplits>({
|
||||
x: [],
|
||||
y: []
|
||||
y: [],
|
||||
subdivisions: {}
|
||||
});
|
||||
|
||||
// --- ЛОГИКА ВОССТАНОВЛЕНИЯ ИЗ ССЫЛКИ ---
|
||||
@@ -29,7 +31,11 @@ const App = () => {
|
||||
const sharedData = parseShareUrl();
|
||||
if (sharedData) {
|
||||
setConfig(sharedData.config);
|
||||
setSplits(sharedData.splits);
|
||||
// Если в старой ссылке нет subdivisions, добавляем пустое
|
||||
setSplits({
|
||||
...sharedData.splits,
|
||||
subdivisions: sharedData.splits.subdivisions || {}
|
||||
});
|
||||
setStep(3);
|
||||
setIsLoadedFromUrl(true);
|
||||
window.history.replaceState({}, '', window.location.pathname);
|
||||
@@ -122,7 +128,7 @@ const App = () => {
|
||||
<button
|
||||
onClick={() => {
|
||||
setStep(1);
|
||||
setSplits({x: [], y: []});
|
||||
setSplits({x: [], y: [], subdivisions: {}});
|
||||
window.history.replaceState({}, '', window.location.pathname);
|
||||
}}
|
||||
className="flex items-center gap-2 px-6 py-3 rounded-lg font-semibold text-gray-400 hover:text-white transition-colors border border-transparent hover:border-slate-700"
|
||||
|
||||
Reference in New Issue
Block a user