tdweb: fixes

GitOrigin-RevId: 39cbb2f7a38cf15dd1bcddf417dad0a878b09337
This commit is contained in:
Arseny Smirnov 2019-04-13 14:55:52 +03:00
parent ae71aaf3c2
commit 30a526f2f0
2 changed files with 8 additions and 14 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@arseny30/tdweb", "name": "@arseny30/tdweb",
"version": "0.2.38", "version": "0.2.39",
"description": "Javascript interface for TDLib (telegram library)", "description": "Javascript interface for TDLib (telegram library)",
"main": "dist/tdweb.js", "main": "dist/tdweb.js",
"files": [ "files": [

View File

@ -244,9 +244,8 @@ class DbFileSystem {
}); });
}); });
let root_dir = FS.lookupPath(root);
let rmrf = (path) => { let rmrf = (path) => {
log.debug("rmrf " , path); log.debug("rmrf ", path);
let info = FS.lookupPath(path); let info = FS.lookupPath(path);
log.debug("rmrf " , path, info); log.debug("rmrf " , path, info);
if (info.node.isFolder) { if (info.node.isFolder) {
@ -260,18 +259,13 @@ class DbFileSystem {
FS.unlink(path); FS.unlink(path);
} }
}; };
for (var key in root_dir.node.contents) { var dirs = ['thumbnails', 'profile_photos', 'secret', 'stickers', 'temp', 'wallpapers', 'secret_thumbnails', 'passport'];
let value = root_dir.node.contents[key]; for (let i in dirs) {
log.debug("node " , key, value); let dir = root + '/' + dirs[i];
if (!value.isFolder) { rmrf(dir)
continue; //FS.mkdir(dir);
} //FS.mount(FS.filesystems.MEMFS, {}, dir);
rmrf(root_dir.path + '/' + value.name);
} }
log.error(root_dir);
let temp_path = root + '/temp';
FS.mkdir(temp_path);
FS.mount(FS.filesystems.MEMFS, {}, temp_path);
dbfs.syncfsInterval = setInterval(() => { dbfs.syncfsInterval = setInterval(() => {
dbfs.sync(); dbfs.sync();
}, 5000); }, 5000);