Skip to content

Commit 186f118

Browse files
authored
STRIPESFF-35 always permit navigation to /logout locations (#110)
Always permit navigation to a `/logout` location, even if it would normally be prevented due to a dirty form. Refs STRIPESFF-35
1 parent 38e6595 commit 186f118

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## 8.1.0 IN PROGRESS
44

5+
* Ignore the dirty-form prompt when navigating to a logout location. STRIPESFF-35.
6+
7+
## [8.0.1](https://github.com/folio-org/stripes-final-form/tree/v8.0.1) (2024-03-13)
8+
[Full Changelog](https://github.com/folio-org/stripes-final-form/compare/v8.0.0...v8.0.1)
9+
10+
* Update translations
11+
512
## [8.0.0](https://github.com/folio-org/stripes-final-form/tree/v8.0.0) (2023-10-11)
613
[Full Changelog](https://github.com/folio-org/stripes-final-form/compare/v7.0.0...v8.0.0)
714

lib/StripesFinalFormWrapper.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ class StripesFinalFormWrapper extends Component {
3131

3232
if (navigationCheck) {
3333
this.unblock = history.block(nextLocation => {
34+
// STRIPESFF-35 / STFORM-42 require the nav-prompt to be ignored
35+
// on logout. consider calling a common function if this ever needs
36+
// to be more elaborate; until then, admire this dead-simple impl.
37+
if (nextLocation.pathname.startsWith('/logout')) {
38+
return true;
39+
}
40+
3441
const {
3542
dirty,
3643
submitSucceeded,

0 commit comments

Comments
 (0)