Skip to content

Commit

Permalink
STRIPESFF-35 always permit navigation to /logout locations (#110)
Browse files Browse the repository at this point in the history
Always permit navigation to a `/logout` location, even if it would
normally be prevented due to a dirty form.

Refs STRIPESFF-35

(cherry picked from commit 186f118)
zburke committed Aug 21, 2024
1 parent 8dbd7ce commit 7e69381
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,13 @@

* Update translations

* Ignore the dirty-form prompt when navigating to a logout location. STRIPESFF-35.

## [8.0.1](https://github.com/folio-org/stripes-final-form/tree/v8.0.1) (2024-03-13)
[Full Changelog](https://github.com/folio-org/stripes-final-form/compare/v8.0.0...v8.0.1)

* Update translations

## [8.0.0](https://github.com/folio-org/stripes-final-form/tree/v8.0.0) (2023-10-11)
[Full Changelog](https://github.com/folio-org/stripes-final-form/compare/v7.0.0...v8.0.0)

7 changes: 7 additions & 0 deletions lib/StripesFinalFormWrapper.js
Original file line number Diff line number Diff line change
@@ -31,6 +31,13 @@ class StripesFinalFormWrapper extends Component {

if (navigationCheck) {
this.unblock = history.block(nextLocation => {
// STRIPESFF-35 / STFORM-42 require the nav-prompt to be ignored
// on logout. consider calling a common function if this ever needs
// to be more elaborate; until then, admire this dead-simple impl.
if (nextLocation.pathname.startsWith('/logout')) {
return true;
}

const {
dirty,
submitSucceeded,

0 comments on commit 7e69381

Please sign in to comment.