fix: uploadFile when folder is undefined
Some checks failed
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/pr/test Pipeline failed

In uploadFile, folder can be undefined when uploading to the parent
folder.
This commit is contained in:
Norm 2022-08-11 17:59:17 -04:00
parent a267e7afdc
commit 451cc203b5
Signed by: norm
GPG key ID: 7123E30E441E80DE

View file

@ -29,11 +29,11 @@ const mimeTypeMap = {
export function uploadFile(
file: File,
folder?: any,
folder?: string | Record<string, any>,
name?: string,
keepOriginal: boolean = defaultStore.state.keepOriginalUploading,
): Promise<Misskey.entities.DriveFile> {
const folderId = typeof folder === 'string' ? folder : folder.id;
const folderId = typeof folder === 'string' ? folder : folder?.id;
return new Promise((resolve, reject) => {
const id = Math.random().toString();