Skip to content

Commit

Permalink
fix conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Jan 4, 2025
1 parent df68342 commit 9722e1d
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/components/FolderWatcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,23 @@ function stopWatching() {
}
function handleFolderChange(event: WatchEvent): void {
console.log(event.type, event.paths);
if (event.type.access.mode !== 'write') {
return;
}
if (event.paths.find(filename => isMultiGamePgn(filename))) {
status.setRoundHasMultiGamePgn(props.round.round.id);
}
const type = event.type;
if (typeof type !== 'string' && 'access' in type && 'mode' in type.access && type.access.mode === 'write') {
if (event.paths.find(filename => isMultiGamePgn(filename))) {
status.setRoundHasMultiGamePgn(props.round.round.id);
}
const toUpload = multiOrSingleFilter(event.paths);
const toUpload = multiOrSingleFilter(event.paths);
if (toUpload.length === 0) {
return;
}
if (toUpload.length === 0) {
return;
}
add_to_queue(props.round.round.id, toUpload);
add_to_queue(props.round.round.id, toUpload);
const paths = toUpload.map(file => file.split('/').pop());
logs.info(`Modified: ${paths.join(', ')}`);
const paths = toUpload.map(file => file.split('/').pop());
logs.info(`Modified: ${paths.join(', ')}`);
}
}
async function resetAndReupload() {
Expand Down

0 comments on commit 9722e1d

Please sign in to comment.