Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,15 @@ const screenshotOptionsInstance = computed(() =>
),
)
const screenshotsError = computed(() => {
const error =
const error: unknown =
screenshotsQuery.error.value ||
(groupBy.value === 'custom' ? screenshotGroupsQuery.error.value : null)
return error instanceof Error ? error : error ? new Error(String(error)) : null
if (!error) return null
if (error instanceof Error) return error
if (typeof error === 'object' && 'message' in error && typeof error.message === 'string') {
return new Error(error.message)
}
return new Error(String(error))
})
const selectionActive = computed(() => selectedKeys.value.size > 0)
const selectedScreenshots = computed(() =>
Expand Down
10 changes: 10 additions & 0 deletions packages/app-lib/src/api/instance/screenshots/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,16 @@ pub(super) async fn source_screenshots_dir(
.await
.map_err(|error| IOError::with_path(error, &instance_dir))?;
let screenshots_dir = canonical_instance_dir.join(SCREENSHOTS_DIRECTORY);
let screenshots_dir = match tokio::fs::canonicalize(&screenshots_dir).await
{
Ok(path) => path,
Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
screenshots_dir
}
Err(error) => {
return Err(IOError::with_path(error, &screenshots_dir).into());
}
};

ensure_directory_is_not_symlink(&screenshots_dir).await?;
Ok(screenshots_dir)
Expand Down
Loading