diff --git a/src/puter-js/src/modules/FileSystem/index.js b/src/puter-js/src/modules/FileSystem/index.js index 0a3adfaa4..45295948b 100644 --- a/src/puter-js/src/modules/FileSystem/index.js +++ b/src/puter-js/src/modules/FileSystem/index.js @@ -113,8 +113,22 @@ export class PuterJSFileSystemModule extends AdvancedBase { } bindSocketEvents() { - this.socket.on('cache.updated', (item) => { - this.postUpdate(); + this.socket.on('cache.updated', (msg) => { + // check original_client_socket_id and if it matches this.socket.id, don't post update + if (msg.original_client_socket_id === this.socket.id) { + return; + }else{ + this.postUpdate(); + } + }); + + this.socket.on('item.renamed', (item) => { + // check original_client_socket_id and if it matches this.socket.id, don't post update + if (item.original_client_socket_id === this.socket.id) { + return; + }else{ + this.postUpdate(); + } }); this.socket.on('connect', () => {