mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-26 11:03:21 +00:00
- Prettified some source.
- Fixed the issue which the filename is shown as `undefined`. - Fixed the issue where files transferred at short intervals were not reflected. - Updated dependency (including new translation)
This commit is contained in:
1 parent
f2b667d75e
commit
54e64c59a9
2 files changed
+5
-8
No files matched your search
+1
-1
Submodule src/lib updated: 6305e8952b...90ace6de16.
@@ -205,13 +205,10 @@ export class ModuleFileHandler extends AbstractModule implements ICoreModule {
|
|||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
const file = typeof info === "string" ? this.storage.getFileStub(info) : info;
|
const file = typeof info === "string" ? this.storage.getFileStub(info) : info;
|
||||||
const mode = file == null ? "create" : "modify";
|
const mode = file == null ? "create" : "modify";
|
||||||
|
const pathFromEntryInfo = typeof entryInfo === "string" ? entryInfo : getPath(entryInfo);
|
||||||
const docEntry =
|
const docEntry = await this.db.fetchEntryMeta(pathFromEntryInfo, undefined, true);
|
||||||
typeof entryInfo === "string"
|
|
||||||
? await this.db.fetchEntryMeta(entryInfo, undefined, true)
|
|
||||||
: await this.db.fetchEntryMeta(entryInfo.path, undefined, true);
|
|
||||||
if (!docEntry) {
|
if (!docEntry) {
|
||||||
this._log(`File ${file?.path} is not exist on the database`, LOG_LEVEL_VERBOSE);
|
this._log(`File ${pathFromEntryInfo} is not exist on the database`, LOG_LEVEL_VERBOSE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const path = getPath(docEntry);
|
const path = getPath(docEntry);
|
||||||
@@ -275,7 +272,7 @@ export class ModuleFileHandler extends AbstractModule implements ICoreModule {
|
|||||||
}
|
}
|
||||||
// 2. if not, the content should be checked.
|
// 2. if not, the content should be checked.
|
||||||
|
|
||||||
if (shouldApplied) {
|
if (!shouldApplied) {
|
||||||
const readFile = await this.readFileFromStub(existDoc);
|
const readFile = await this.readFileFromStub(existDoc);
|
||||||
if (await isDocContentSame(docData, readFile.body)) {
|
if (await isDocContentSame(docData, readFile.body)) {
|
||||||
// The content is same. So, we do not need to update the file.
|
// The content is same. So, we do not need to update the file.
|
||||||
|
|||||||
Reference in new issue
Block a user