Skip to content

Commit 30f2ad1

Browse files
committed
Added support for request restore with ajax
1 parent 190f630 commit 30f2ad1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Application/UI/Presenter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ public function storeRequest($expiration = '+ 10 minutes')
10921092
$key = Nette\Utils\Random::generate(5);
10931093
} while (isset($session[$key]));
10941094

1095-
$session[$key] = [$this->getUser()->getId(), $this->request];
1095+
$session[$key] = [$this->getUser()->getId(), $this->request, $this->httpRequest->getUrl()];
10961096
$session->setExpiration($expiration, $key);
10971097
return $key;
10981098
}
@@ -1110,7 +1110,11 @@ public function restoreRequest($key)
11101110
return;
11111111
}
11121112
$request = clone $session[$key][1];
1113+
$url = $session[$key][2];
11131114
unset($session[$key]);
1115+
if($this->isAjax()) {
1116+
$this->redirectUrl($url);
1117+
}
11141118
$request->setFlag(Application\Request::RESTORED, TRUE);
11151119
$params = $request->getParameters();
11161120
$params[self::FLASH_KEY] = $this->getParameter(self::FLASH_KEY);

0 commit comments

Comments
 (0)