6.18.2: Фикс навигации назад после создания задачи
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m16s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m16s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "play-life-web",
|
||||
"version": "6.18.1",
|
||||
"version": "6.18.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -948,7 +948,19 @@ function AppContent() {
|
||||
if (isNewTabMain) {
|
||||
clearUrl()
|
||||
} else if (isNewTabDeep) {
|
||||
updateUrl(tab, {}, activeTab)
|
||||
// Если текущая запись — модальное окно, заменяем её вместо push
|
||||
const currentState = window.history.state || {}
|
||||
const isFromModal = currentState.modalOpen === true || currentState.conditionForm === true
|
||||
if (isFromModal) {
|
||||
const url = new URL(window.location)
|
||||
url.searchParams.set('tab', tab)
|
||||
const keysToRemove = []
|
||||
url.searchParams.forEach((value, key) => { if (key !== 'tab') keysToRemove.push(key) })
|
||||
keysToRemove.forEach(key => url.searchParams.delete(key))
|
||||
window.history.replaceState({ tab, params: {}, previousTab: activeTab }, '', url)
|
||||
} else {
|
||||
updateUrl(tab, {}, activeTab)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
setTabParams(params)
|
||||
|
||||
Reference in New Issue
Block a user