From 30a526f2f0ebb3044e8cc937d83a6da952f7b90e Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Sat, 13 Apr 2019 14:55:52 +0300 Subject: [PATCH] tdweb: fixes GitOrigin-RevId: 39cbb2f7a38cf15dd1bcddf417dad0a878b09337 --- example/web/tdweb/package.json | 2 +- example/web/tdweb/src/worker.js | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/example/web/tdweb/package.json b/example/web/tdweb/package.json index d766659b8..b37a74723 100644 --- a/example/web/tdweb/package.json +++ b/example/web/tdweb/package.json @@ -1,6 +1,6 @@ { "name": "@arseny30/tdweb", - "version": "0.2.38", + "version": "0.2.39", "description": "Javascript interface for TDLib (telegram library)", "main": "dist/tdweb.js", "files": [ diff --git a/example/web/tdweb/src/worker.js b/example/web/tdweb/src/worker.js index 1a5e030b9..d455c4f7e 100644 --- a/example/web/tdweb/src/worker.js +++ b/example/web/tdweb/src/worker.js @@ -244,9 +244,8 @@ class DbFileSystem { }); }); - let root_dir = FS.lookupPath(root); let rmrf = (path) => { - log.debug("rmrf " , path); + log.debug("rmrf ", path); let info = FS.lookupPath(path); log.debug("rmrf " , path, info); if (info.node.isFolder) { @@ -260,18 +259,13 @@ class DbFileSystem { FS.unlink(path); } }; - for (var key in root_dir.node.contents) { - let value = root_dir.node.contents[key]; - log.debug("node " , key, value); - if (!value.isFolder) { - continue; - } - rmrf(root_dir.path + '/' + value.name); + var dirs = ['thumbnails', 'profile_photos', 'secret', 'stickers', 'temp', 'wallpapers', 'secret_thumbnails', 'passport']; + for (let i in dirs) { + let dir = root + '/' + dirs[i]; + rmrf(dir) + //FS.mkdir(dir); + //FS.mount(FS.filesystems.MEMFS, {}, dir); } - log.error(root_dir); - let temp_path = root + '/temp'; - FS.mkdir(temp_path); - FS.mount(FS.filesystems.MEMFS, {}, temp_path); dbfs.syncfsInterval = setInterval(() => { dbfs.sync(); }, 5000);