Skip to content

Commit

Permalink
fix(Scanner): Fix root folder sync
Browse files Browse the repository at this point in the history
fixes #1364
  • Loading branch information
marcelklehr committed Mar 29, 2023
1 parent 2e8e571 commit 18058bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lib/Scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class Scanner {
return
}

if (typeof newFolder.parentId === 'undefined' && newFolder.isRoot && newFolder.location === ItemLocation.LOCAL) {
if (newFolder.isRoot && newFolder.location === ItemLocation.LOCAL) {
// We can't remove root folders locally
return
}
Expand All @@ -76,7 +76,7 @@ export default class Scanner {
// created Items
// (using map here, because 'each' doesn't provide indices)
await Parallel.map(unmatchedChildren, async(newChild, index) => {
if (typeof oldFolder.parentId === 'undefined' && oldFolder.isRoot && oldFolder.location === ItemLocation.LOCAL) {
if (oldFolder.isRoot && oldFolder.location === ItemLocation.LOCAL) {
// We can't create root folders locally
return
}
Expand Down
9 changes: 4 additions & 5 deletions src/lib/browser/BrowserTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default class BrowserTree implements IResource {
'=>',
overrideTitle
)
isRoot = true
}
}
if (node.id === this.absoluteRoot.id) {
Expand Down Expand Up @@ -242,11 +241,11 @@ export default class BrowserTree implements IResource {
const {id, title, parentId} = folder
Logger.log('(local)UPDATEFOLDER', folder)
if (folder.parentId === this.absoluteRoot.id) {
Logger.log('This action affects the absolute root. Skipping.')
Logger.log('This action affects a root folder. Skipping.')
return
}
if (folder.isRoot) {
Logger.log('This is a root folder. Skip.')
Logger.log('This is the absolute root folder. Skip.')
return
}
try {
Expand All @@ -273,11 +272,11 @@ export default class BrowserTree implements IResource {
const id = folder.id
Logger.log('(local)REMOVEFOLDER', id)
if (folder.parentId === this.absoluteRoot.id) {
Logger.log('This action affects the absolute root. Skipping.')
Logger.log('This action affects a root folder. Skipping.')
return
}
if (folder.isRoot) {
Logger.log('This is a root folder. Skip.')
Logger.log('This is the root folder. Skip.')
return
}
try {
Expand Down

0 comments on commit 18058bd

Please sign in to comment.