Skip to content

Commit

Permalink
fix: user-attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Jan 17, 2025
1 parent 1bc3273 commit 11ed4bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"unplugin-auto-import": "0.19.0",
"unplugin-data": "0.1.1",
"unplugin-vue-components": "0.27.5",
"user-attachments": "1.1.2",
"user-attachments": "2.0.2",
"vite": "6.0.3",
"vite-plugin-monkey": "5.0.0",
"vue": "3.5.13",
Expand Down
28 changes: 6 additions & 22 deletions pnpm-lock.yaml

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

8 changes: 4 additions & 4 deletions src/utils/github.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PoliciesAsset } from 'user-attachments';
import { uploadPoliciesAssets } from 'user-attachments';
import { UploadError, uploadPoliciesAssets } from 'user-attachments';
import { enhanceFetch } from './fetch';

export type GithubPoliciesAsset = PoliciesAsset;
Expand All @@ -9,11 +9,11 @@ export const uploadAsset = async (
name: string,
): Promise<PoliciesAsset> => {
return await uploadPoliciesAssets({
repositoryId: '661952005',
file: new File([bf], name),
url: 'https://github.com/gkd-kit/inspect/issues/1',
fetch: enhanceFetch,
}).catch((e) => {
if (e instanceof Error && e.message === 'not found authenticity_token') {
}).catch(async (e) => {
if (e instanceof UploadError) {
useGlobalStore().githubErrorDlgVisible = true;
}
throw e;
Expand Down

0 comments on commit 11ed4bf

Please sign in to comment.