decord/source/modules/threads/FormError.tsx
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

75 lines
2.4 KiB
TypeScript

// Module ID: 16862
// Function ID: 16863
// Name: threads/FormError
// Dependencies: [1115, 8075, 2]
// Exports: makeApiNameRequiredError, makeAutomodViolationError, makeEmptyMessageError, makeEmptyTitleError, renderError
// Module 16862 (threads/FormError)
import util from "util" /* 1115 */;
import AutomodErrorUtils from "AutomodErrorUtils" /* 8075 */;
import size from "module_2" /* 2 */;
const FormSubmitErrorType = { EmptyContent: 0, [0]: "EmptyContent", AutomodViolation: 1, [1]: "AutomodViolation", ApiValidation: 2, [2]: "ApiValidation" };
const result = size.fileFinishedImporting("modules/threads/FormError.tsx");
export { FormSubmitErrorType };
export const makeEmptyTitleError = function makeEmptyTitleError() {
const intl = util.intl;
let stringResult = intl.string(util.t.uXA573);
obj = { type: obj.EmptyContent, message: null };
if (stringResult == null) {
stringResult = null;
}
obj.message = stringResult;
return obj;
};
export const makeEmptyMessageError = function makeEmptyMessageError() {
const intl = util.intl;
let stringResult = intl.string(util.t.kesTVT);
obj = { type: obj.EmptyContent, message: null };
if (stringResult == null) {
stringResult = null;
}
obj.message = stringResult;
return obj;
};
export const makeApiNameRequiredError = function makeApiNameRequiredError() {
const intl = util.intl;
let stringResult = intl.string(util.t.uXA573);
obj = { type: obj.ApiValidation, message: null };
if (stringResult == null) {
stringResult = null;
}
obj.message = stringResult;
return obj;
};
export const makeAutomodViolationError = function makeAutomodViolationError(errorResponseBody, id) {
const obj = AutomodErrorUtils;
id = undefined;
if (id != null) {
id = id.id;
}
let automodErrorMessageFromErrorResponse = obj.getAutomodErrorMessageFromErrorResponse(errorResponseBody, id);
const obj2 = { type: obj.AutomodViolation, message: null };
if (automodErrorMessageFromErrorResponse == null) {
automodErrorMessageFromErrorResponse = null;
}
obj2.message = automodErrorMessageFromErrorResponse;
return obj2;
};
export const renderError = function renderError(type, content) {
let tmp = null;
if (null != type) {
if (type.type === obj.EmptyContent) {
if (null != content.content) {
tmp = null;
}
}
let message = type.message;
if (message == null) {
message = null;
}
tmp = message;
}
return tmp;
};