-
Notifications
You must be signed in to change notification settings - Fork 6
fix(e-signer): file upload error handling #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
19c7765
1394dd3
67e38e9
ae6b7d2
cb81d95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| import { onMount } from 'svelte'; | ||
| import { goto } from '$app/navigation'; | ||
| import { isAuthenticated } from '$lib/stores/auth'; | ||
| import { uploadFile } from '$lib/stores/files'; | ||
| import { files, fetchFiles, uploadFile, FileSizeError } from '$lib/stores/files'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: rg -n '\b(files|fetchFiles)\b' 'platforms/esigner/src/routes/(protected)/files/new/+page.svelte' | grep -v 'import'Repository: MetaState-Prototype-Project/prototype Length of output: 1067 Remove unused imports The imports 🤖 Prompt for AI Agents |
||
| import { apiClient } from '$lib/utils/axios'; | ||
| import { inviteSignees } from '$lib/stores/invitations'; | ||
|
|
||
|
|
@@ -59,7 +59,11 @@ | |
| } | ||
| } catch (err) { | ||
| console.error('Upload failed:', err); | ||
| alert('Failed to upload file'); | ||
| if (err instanceof FileSizeError) { | ||
| alert(err.message); | ||
| } else { | ||
| alert('Failed to upload file. Please try again.'); | ||
| } | ||
| throw err; | ||
| } finally { | ||
| isLoading = false; | ||
|
|
@@ -126,7 +130,7 @@ | |
| alert('You cannot invite yourself. You are automatically added as a signee.'); | ||
| return; | ||
| } | ||
|
|
||
| if (!selectedUsers.find(u => u.id === user.id)) { | ||
| selectedUsers = [...selectedUsers, user]; | ||
| } | ||
|
|
@@ -147,10 +151,10 @@ | |
| try { | ||
| isSubmitting = true; | ||
| const userIds = selectedUsers.map(u => u.id); | ||
|
|
||
| // Backend will automatically add owner as signee | ||
| await inviteSignees(selectedFile.id, userIds); | ||
|
|
||
| goto(`/files/${selectedFile.id}`); | ||
| } catch (err) { | ||
| console.error('Failed to create invitations:', err); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.