Skip to content

Commit

Permalink
修复 cacheKey 中包含 . 时 dropByCacheKey 不生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CJY0208 committed Dec 5, 2019
1 parent 62f6b4f commit 41e5177
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions dist/cacheRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@
function isScrollableNode() {
var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

// if (!isExist(node)) {
// return false
// }
if (!isExist(node)) {
return false;
}

return node.scrollWidth > node.clientWidth || node.scrollHeight > node.clientHeight;
}
Expand Down Expand Up @@ -352,7 +352,7 @@
};

var dropByCacheKey = function dropByCacheKey(key) {
var cache = get(__components, key);
var cache = get(__components, [key]);

if (!cache) {
return;
Expand Down
2 changes: 1 addition & 1 deletion dist/cacheRoute.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router-cache-route",
"version": "1.8.3",
"version": "1.8.4",
"description": "cache-route for react-router base on react v15+ and router v4+",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/core/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const remove = key => {
const dropComponent = component => run(component, 'reset')

export const dropByCacheKey = key => {
const cache = get(__components, key)
const cache = get(__components, [key])

if (!cache) {
return
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/saveScrollPosition.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const screenScrollingElement = get(
)

function isScrollableNode(node = {}) {
// if (!isExist(node)) {
// return false
// }
if (!isExist(node)) {
return false
}

return (
node.scrollWidth > node.clientWidth || node.scrollHeight > node.clientHeight
Expand Down

0 comments on commit 41e5177

Please sign in to comment.