Skip to content

Commit

Permalink
only run cleanup when leaving library
Browse files Browse the repository at this point in the history
  • Loading branch information
Zasa-san committed Jan 24, 2025
1 parent e7ce32d commit f35f325
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
5 changes: 4 additions & 1 deletion app/react/Library/Library.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ class LibraryRootComponent extends RouteHandler {
}

componentWillUnmount() {
this.emptyState();
const nextLocation = window?.location?.pathname;
if (!nextLocation.includes('library')) {
this.emptyState();
}
}

emptyState() {
Expand Down
5 changes: 0 additions & 5 deletions app/react/Library/LibraryCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ class LibraryCardsComponent extends LibraryRootComponent {
return requestState(requestParams, globalResources);
}

componentWillUnmount() {
// override unmount behavior to avoid race condition with requestState.
// the race condition is a conflict with react-router and our RouterHandler class components.
}

render() {
trackPage();
return (
Expand Down
5 changes: 0 additions & 5 deletions app/react/Library/LibraryMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ class LibraryMapComponent extends LibraryRootComponent {
return requestState(requestParams, globalResources, { geolocation: true });
}

componentWillUnmount() {
// override unmount behavior to avoid race condition with requestState.
// the race condition is a conflict with react-router and our RouterHandler class components.
}

render() {
trackPage();
return (
Expand Down
5 changes: 0 additions & 5 deletions app/react/Library/LibraryTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ class LibraryTableComponent extends LibraryRootComponent {
return requestState(requestParams, globalResources, { calculateTableColumns: true });
}

componentWillUnmount() {
// override unmount behavior to avoid race condition with requestState.
// the race condition is a conflict with react-router and our RouterHandler class components.
}

render() {
trackPage();
return (
Expand Down

0 comments on commit f35f325

Please sign in to comment.