Route markdown to v1 (#680)
I think I just forgot to do it the first time.
This commit is contained in:
parent
431f55ef26
commit
c90c5bcc2a
2 changed files with 3 additions and 2 deletions
2
flow-typed/publish.js
vendored
2
flow-typed/publish.js
vendored
|
@ -56,7 +56,7 @@ declare type PublishParams = {
|
|||
declare type TusUploader = any;
|
||||
|
||||
declare type FileUploadSdkParams = {
|
||||
file_path: string,
|
||||
file_path: string | File,
|
||||
name: ?string,
|
||||
preview?: boolean,
|
||||
remote_url?: string,
|
||||
|
|
|
@ -16,6 +16,7 @@ export default function apiPublishCallViaWeb(
|
|||
reject: Function
|
||||
) {
|
||||
const { file_path: filePath, preview, remote_url: remoteUrl } = params;
|
||||
const isMarkdown = filePath && typeof filePath === 'object' && filePath.type === 'text/markdown';
|
||||
|
||||
if (!filePath && !remoteUrl) {
|
||||
return apiCall(method, params, resolve, reject);
|
||||
|
@ -41,7 +42,7 @@ export default function apiPublishCallViaWeb(
|
|||
params.guid = uuid();
|
||||
}
|
||||
|
||||
const useV1 = remoteUrl || preview || !tus.isSupported;
|
||||
const useV1 = remoteUrl || isMarkdown || preview || !tus.isSupported;
|
||||
|
||||
// Note: both function signature (params) should match.
|
||||
const makeRequest = useV1 ? makeUploadRequest : makeResumableUploadRequest;
|
||||
|
|
Loading…
Reference in a new issue