File tree Expand file tree Collapse file tree
src/pages/app/components/Option/categories/Limit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ const TestButton: FunctionalComponent<{ onClick: NoArgCallback }> = props => (
9797
9898const _default = defineComponent ( ( _ , ctx ) => {
9999 const { option } = useOption < tt4b . option . LimitOption > ( { defaultValue : DEFAULT_LIMIT , copy } )
100- const { verified, verify } = useVerify ( option )
100+ const { verified, verify } = useVerify ( option , true )
101101 const { modifyPsw } = usePswEdit ( { reset : ( ) => option . limitPassword } )
102102 const { setup2fa } = use2faSetup ( )
103103
Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ import { listLimits } from "@api/sw/limit"
22import { judgeVerificationRequired , processVerification } from "@app/util/limit/index"
33import { ref } from "vue"
44
5- export const useVerify = ( option : tt4b . option . LimitOption ) => {
5+ /**
6+ * @param pswRequired must verify password even not triggered yet
7+ */
8+ export const useVerify = ( option : tt4b . option . LimitOption , pswRequired ?: boolean ) => {
69 const verified = ref ( false )
710
811 const verify = async ( ) : Promise < void > => {
@@ -11,7 +14,9 @@ export const useVerify = (option: tt4b.option.LimitOption) => {
1114 const delayDuration = option . limitDelayDuration
1215 const triggerResults = await Promise . all ( items . map ( item => judgeVerificationRequired ( item , delayDuration ) ) )
1316 const anyTrigger = triggerResults . some ( t => t )
14- if ( anyTrigger ) await processVerification ( option )
17+ // Need to verify password at the first time
18+ const verifyPsw = pswRequired && option . limitLevel === 'password'
19+ if ( anyTrigger || verifyPsw ) await processVerification ( option )
1520 verified . value = true
1621 }
1722
You can’t perform that action at this time.
0 commit comments