1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

use image last modified time to remove browser cache (#7554)

* use image last modified time to remove browser cache

* remove useless
This commit is contained in:
Michael An
2025-03-05 17:01:54 +08:00
committed by GitHub
parent e8de9ba848
commit a83adb7929
28 changed files with 107 additions and 164 deletions

View File

@@ -1779,13 +1779,28 @@ class LibContentView extends React.Component {
updateDirent = (dirent, paramKey, paramValue) => {
let newDirentList = this.state.direntList.map(item => {
if (item.name === dirent.name) {
item[paramKey] = paramValue;
if (typeof paramKey === 'string') {
item[paramKey] = paramValue;
} else if (Array.isArray(paramKey)) {
paramKey.forEach((key, index) => {
item[key] = paramValue[index];
});
}
}
return item;
});
this.setState({ direntList: newDirentList });
};
updateTreeNode = (path, keys, values) => {
let tree = this.state.treeData.clone();
let node = tree.getNodeByPath(path);
tree.updateNode(node, keys, values);
this.setState({
treeData: tree,
});
};
// tree operations
loadTreeNodeByPath = (path) => {
let repoID = this.props.repoID;
@@ -2420,6 +2435,7 @@ class LibContentView extends React.Component {
updateCurrentDirent={this.updateCurrentDirent}
updateCurrentPath={this.updatePath}
toggleShowDirentToolbar={this.toggleShowDirentToolbar}
updateTreeNode={this.updateTreeNode}
/>
:
<div className="message err-tip">{gettext('Folder does not exist.')}</div>