@debounced(300)
    async submitAsync() {
        const {username, password, loadModel, isValid} = this;
        if (!isValid) return;

        try {
            this.setLoginInProgress(true);
            const resp = await XH.fetchJson({
                url: 'xh/login',
                params: {username, password}
            }).linkTo(
                loadModel
            ).catchDefault({
                hideParams: ['password']
            });

            if (resp.success) {
                this.setWarning('');
                await XH.completeInitAsync();
            } else {
                this.setWarning('Login incorrect.');
            }
        } finally {
            this.setLoginInProgress(false);
        }

    }
// Debounce to defend against double-click fast enough to get through masking + button disable.
Debounce to defend against double-click fast enough to get through masking + button disable.
Debounce to defend against double - click fast enough to get through masking + button disable .
@debounced(300)
    async submitAsync() {
        const {username, password, loadModel, isValid} = this;
        if (!isValid) return;
        try {
            this.setLoginInProgress(true);
            const resp = await XH.fetchJson({
                url: 'xh/login',
                params: {username, password}
            }).linkTo(
                loadModel
            ).catchDefault({
                hideParams: ['password']
            });
            if (resp.success) {
                this.setWarning('');
                await XH.completeInitAsync();
            } else {
                this.setWarning('Login incorrect.');
            }
        } finally {
            this.setLoginInProgress(false);
        }
    }
@ debounced ( 300 ) async submitAsync ( ) { const { username , password , loadModel , isValid } = this ; if ( ! isValid ) return ; try { this . setLoginInProgress ( true ) ; const resp = await XH . fetchJson ( { url : 'xh/login' , params : { username , password } } ) . linkTo ( loadModel ) . catchDefault ( { hideParams : [ 'password' ] } ) ; if ( resp . success ) { this . setWarning ( '' ) ; await XH . completeInitAsync ( ) ; } else { this . setWarning ( 'Login incorrect.' ) ; } } finally { this . setLoginInProgress ( false ) ; } }
Debounce to defend against double-click fast enough to get through masking + button disable.
Debounce to defend against double - click fast enough to get through masking + button disable .