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",
"version": "0.2.38",
"version": "0.2.39",
"description": "Javascript interface for TDLib (telegram library)",
"main": "dist/tdweb.js",
"files": [

View File

@ -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;
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);
}
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.sync();
}, 5000);