Skip to content

Commit

Permalink
upgrade plugin-fs ts
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Dec 9, 2024
1 parent c7ff5ea commit 38b3f46
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/dist
/src-tauri/gen/schemas
/src-tauri/target
/src-tauri/templates

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"@headlessui/vue": "^1.7.23",
"@heroicons/vue": "^2.2.0",
"@tauri-apps/api": "^2.1.1",
"@tauri-apps/plugin-dialog": "~2",
"@tauri-apps/plugin-fs": "~2",
"@tauri-apps/plugin-notification": "~2",
"@tauri-apps/plugin-shell": "~2",
"@tauri-apps/plugin-updater": "~2",
"@tauri-apps/plugin-dialog": "~2.0.1",
"@tauri-apps/plugin-fs": "~2.0.3",
"@tauri-apps/plugin-notification": "~2.0.0",
"@tauri-apps/plugin-shell": "~2.0.1",
"@tauri-apps/plugin-updater": "~2.0.0",
"fetch-ndjson": "^1.1.7",
"openapi-fetch": "^0.13.3",
"pinia": "^2.3.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions src/components/FolderWatcher.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { open } from '@tauri-apps/plugin-dialog';
import { DebouncedEvent, watch } from '@tauri-apps/plugin-fs';
import { watch, WatchEvent } from '@tauri-apps/plugin-fs';
import { useLogStore } from '../stores/logs';
import { useStatusStore } from '../stores/status';
import { add_to_queue, isMultiGamePgn, lichessFetch, multiOrSingleFilter, openPath } from '../utils';
Expand Down Expand Up @@ -55,14 +55,12 @@ function stopWatching() {
status.stopRound(props.round.round.id);
}
function handleFolderChange(events: DebouncedEvent): void {
if (events.find(event => isMultiGamePgn(event.path))) {
function handleFolderChange(event: WatchEvent): void {
if (event.paths.find(filename => isMultiGamePgn(filename))) {
status.setRoundHasMultiGamePgn(props.round.round.id);
}
const files = events.filter(event => event.kind === 'Any').map(event => event.path);
const toUpload = multiOrSingleFilter(files);
const toUpload = multiOrSingleFilter(event.paths);
if (toUpload.length === 0) {
return;
Expand Down

0 comments on commit 38b3f46

Please sign in to comment.