mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 12:27:48 +00:00
[fix repo-update-toast bug] remove unnecessary listener&function (#2765)
This commit is contained in:
@@ -110,7 +110,7 @@ class DirView extends React.Component {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
collabServer.unwatchRepo(this.props.repoID);
|
||||
collabServer.unwatchRepo(this.props.repoID, this.onRepoUpdateEvent);
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
|
@@ -18,10 +18,10 @@ class CollabServer {
|
||||
contact_email: contactEmail,
|
||||
},
|
||||
});
|
||||
socket.on('repo_update', fn)
|
||||
socket.on('repo_update', fn);
|
||||
}
|
||||
|
||||
unwatchRepo(repoID) {
|
||||
unwatchRepo(repoID, fn) {
|
||||
if (!socket) {
|
||||
return;
|
||||
}
|
||||
@@ -34,6 +34,7 @@ class CollabServer {
|
||||
contact_email: contactEmail,
|
||||
},
|
||||
});
|
||||
socket.off('repo_update', fn);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user