mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 12:10:28 +00:00
Merge 152b36f372 into 2ebd201da9
This commit is contained in:
commit
7230b9a44b
2 changed files with 5 additions and 5 deletions
|
|
@ -156,7 +156,7 @@ export function arrayBufferToBase64(buffer: ArrayBuffer): string {
|
|||
}
|
||||
|
||||
export function base64ToArrayBuffer(base64: string): ArrayBuffer {
|
||||
return Buffer.from(base64, "base64");
|
||||
return Buffer.from(base64, "base64").buffer;
|
||||
}
|
||||
|
||||
// Mock Event reference
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ export default class SyncManager {
|
|||
}
|
||||
|
||||
const normalizedPath = normalizePath(targetPath);
|
||||
await this.vault.adapter.writeBinary(normalizedPath, data);
|
||||
await this.vault.adapter.writeBinary(normalizedPath, data.buffer);
|
||||
await this.logger.info("Written file", {
|
||||
normalizedPath,
|
||||
});
|
||||
|
|
@ -724,12 +724,12 @@ export default class SyncManager {
|
|||
}
|
||||
}
|
||||
|
||||
// For non-deletion cases, if SHAs differ, we just need to check if local changed.
|
||||
// For non-deletion cases, if SHAs differ, we need to check if local changed and what file was modified last
|
||||
// Conflicts are already filtered out so we can make this decision easily
|
||||
if (localSHA !== localFile.sha) {
|
||||
if (localSHA !== localFile.sha && remoteFile.lastModified < localFile.lastModified) {
|
||||
actions.push({ type: "upload", filePath: filePath });
|
||||
return;
|
||||
} else {
|
||||
} else if(remoteFile.lastModified > localFile.lastModified) {
|
||||
actions.push({ type: "download", filePath: filePath });
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue