Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

change the boolean variable isAdminPwdField to hasComplexityRequirements

dorj222efe00ae6bec3
diff --git a/web/components/admin/TextField.tsx b/web/components/admin/TextField.tsx
index 340c0fe18f..db772f318e 100644
--- a/web/components/admin/TextField.tsx
+++ b/web/components/admin/TextField.tsx
@@ -32,7 +32,7 @@ export type TextFieldProps = {
useTrim?: boolean;
useTrimLead?: boolean;
value?: string | number;
- isAdminPwdField?: boolean;
+ hasComplexityRequirements?: boolean;
onBlur?: FieldUpdaterFunc;
onChange?: FieldUpdaterFunc;
};
@@ -55,7 +55,7 @@ export const TextField: FC<TextFieldProps> = ({
type,
useTrim,
value,
- isAdminPwdField,
+ hasComplexityRequirements,
}) => {
const [hasPwdChanged, setHasPwdChanged] = useState(false);
const [showPwdButton, setShowPwdButton] = useState(false);
@@ -65,7 +65,7 @@ export const TextField: FC<TextFieldProps> = ({
if (onChange) {
const val = type === TEXTFIELD_TYPE_NUMBER ? e : e.target.value;
setShowPwdButton(true);
- if (isAdminPwdField && REGEX_PASSWORD.test(val)) {
+ if (hasComplexityRequirements && REGEX_PASSWORD.test(val)) {
setHasPwdChanged(true);
} else {
setHasPwdChanged(false);
@@ -150,7 +150,7 @@ export const TextField: FC<TextFieldProps> = ({
</div>
) : null}
- {!isAdminPwdField ? (
+ {!hasComplexityRequirements ? (
<div className="input-side">
<div className="input-group">
<Field
@@ -231,7 +231,7 @@ TextField.defaultProps = {
pattern: '',
useTrim: false,
useTrimLead: false,
- isAdminPwdField: false,
+ hasComplexityRequirements: false,
onSubmit: () => {},
onBlur: () => {},
diff --git a/web/components/admin/TextFieldWithSubmit.tsx b/web/components/admin/TextFieldWithSubmit.tsx
index 5dc633d4c2..facc2ebae1 100644
--- a/web/components/admin/TextFieldWithSubmit.tsx
+++ b/web/components/admin/TextFieldWithSubmit.tsx
@@ -24,7 +24,7 @@ export type TextFieldWithSubmitProps = TextFieldProps & {
apiPath: string;
configPath?: string;
initialValue?: string;
- isAdminPwdField?: boolean;
+ hasComplexityRequirements?: boolean;
};
export const TextFieldWithSubmit: FC<TextFieldWithSubmitProps> = ({
@@ -44,7 +44,7 @@ export const TextFieldWithSubmit: FC<TextFieldWithSubmitProps> = ({
let resetTimer = null;
- const { fieldName, required, tip, status, value, isAdminPwdField, onChange, onSubmit } =
+ const { fieldName, required, tip, status, value, hasComplexityRequirements, onChange, onSubmit } =
textFieldProps;
// Clear out any validation states and messaging
@@ -138,7 +138,7 @@ export const TextFieldWithSubmit: FC<TextFieldWithSubmitProps> = ({
<div className="field-tip">{tip}</div>
<FormStatusIndicator status={status || submitStatus} />
<div className="update-button-container">
- {!isAdminPwdField && (
+ {!hasComplexityRequirements && (
<Button
type="primary"
size="small"
diff --git a/web/utils/config-constants.tsx b/web/utils/config-constants.tsx
index a93544ff23..8337bf40ab 100644
--- a/web/utils/config-constants.tsx
+++ b/web/utils/config-constants.tsx
@@ -122,7 +122,7 @@ export const TEXTFIELD_PROPS_ADMIN_PASSWORD = {
label: 'Admin Password',
tip: 'Save this password somewhere safe, you will need it to login to the admin dashboard!',
required: true,
- isAdminPwdField: true,
+ hasComplexityRequirements: true,
};
export const TEXTFIELD_PROPS_FFMPEG = {
apiPath: API_FFMPEG,
@@ -132,7 +132,7 @@ export const TEXTFIELD_PROPS_FFMPEG = {
label: 'FFmpeg Path',
tip: 'Absolute file path of the FFMPEG application on your server',
required: true,
- isAdminPwdField: false,
+ hasComplexityRequirements: false,
};
export const TEXTFIELD_PROPS_WEB_PORT = {
apiPath: API_WEB_PORT,
@@ -142,7 +142,7 @@ export const TEXTFIELD_PROPS_WEB_PORT = {
label: 'Owncast port',
tip: 'What port is your Owncast web server listening? Default is 8080',
required: true,
- isAdminPwdField: false,
+ hasComplexityRequirements: false,
};
export const TEXTFIELD_PROPS_RTMP_PORT = {
apiPath: API_RTMP_PORT,
@@ -152,7 +152,7 @@ export const TEXTFIELD_PROPS_RTMP_PORT = {
label: 'RTMP port',
tip: 'What port should accept inbound broadcasts? Default is 1935',
required: true,
- isAdminPwdField: false,
+ hasComplexityRequirements: false,
};
export const TEXTFIELD_PROPS_INSTANCE_URL = {
apiPath: API_INSTANCE_URL,