fix: ensure regTy is always uppercase

This commit is contained in:
Alexis Tyler
2021-04-30 07:38:47 +09:30
parent a7a80c1243
commit db13e10e9f
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -261,7 +261,7 @@ const parse = (state: VarIni): Var => {
portssl: toNumber(state.portssl),
porttelnet: toNumber(state.porttelnet),
regCheck: state.regCheck === '' ? 'Valid' : 'Error',
regTy: ['Basic', 'Plus', 'Pro'].includes(state.regTy) ? state.regTy : 'Invalid',
regTy: (['Basic', 'Plus', 'Pro'].includes(state.regTy) ? state.regTy : 'Invalid').toUpperCase(),
// Make sure to use a || not a ?? as regCheck can be an empty string
regState: (state.regCheck || state.regTy).toUpperCase(),
safeMode: iniBooleanToJsBoolean(state.safeMode),
+1 -1
View File
@@ -6,7 +6,7 @@
// @todo: remove string and add rest of the options
type FsType = 'xfs' | string;
type RegistrationCheck = 'Error' | 'Valid';
type RegistrationType = 'Invalid' | 'Basic' | 'Plus' | 'Pro' | string;
type RegistrationType = 'INVALID' | 'BASIC' | 'PLUS' | 'PRO' | string;
/**
* Global vars