| 1 | import type { AppBindings } from "./bridge"; |
| 2 | import { draftIDsFromSubmit } from "./draftCredentials"; |
| 3 | |
| 4 | export function draftSubmit(app: AppBindings, tabId: string, submit: string, submissionId: string) { |
| 5 | const draftIDs = draftIDsFromSubmit(submit); |
| 6 | if (draftIDs.length > 0 && typeof app.StartTurnForTabWithDrafts === "function") { |
| 7 | return app.StartTurnForTabWithDrafts(tabId, submit, submissionId, draftIDs); |
| 8 | } |
| 9 | if (typeof app.StartTurnForTab === "function") return app.StartTurnForTab(tabId, submit, submissionId); |
| 10 | return app.SubmitToTabWithID(tabId, submit, submissionId); |
| 11 | } |
| 12 |