6.17.3: Фикс навигации при редактировании из закупки
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m14s

This commit is contained in:
poignatov
2026-03-15 18:01:28 +03:00
parent 9c915d4675
commit 710adff385
4 changed files with 7 additions and 6 deletions

View File

@@ -231,11 +231,12 @@ function PurchaseScreen({ onNavigate, purchaseConfigId, taskId, taskName }) {
}))
}
const handleCloseDetail = () => {
if (historyPushedForDetailRef.current) {
const handleCloseDetail = (skipHistoryBack) => {
if (!skipHistoryBack && historyPushedForDetailRef.current) {
window.history.back()
} else {
setSelectedItemForDetail(null)
historyPushedForDetailRef.current = false
}
}

View File

@@ -132,7 +132,7 @@ function ShoppingItemForm({ onNavigate, itemId, boardId, previousTab, onSaved })
if (res.ok) {
onSaved?.()
onNavigate(previousTab || 'shopping', { boardId })
window.history.back()
} else {
const err = await res.json()
setToastMessage({ text: err.error || 'Ошибка сохранения', type: 'error' })
@@ -152,7 +152,7 @@ function ShoppingItemForm({ onNavigate, itemId, boardId, previousTab, onSaved })
const res = await authFetch(`/api/shopping/items/${itemId}`, { method: 'DELETE' })
if (res.ok) {
onSaved?.()
onNavigate(previousTab || 'shopping', { boardId })
window.history.back()
} else {
setToastMessage({ text: 'Ошибка удаления', type: 'error' })
setIsDeleting(false)