lampa-app / LAMPA

LAMPA client browser for Android 4.1+ (API level 16+)
193 stars 18 forks source link

LAMPA can not get network status #22

Closed aston314 closed 6 months ago

aston314 commented 6 months ago

like this: network["native"](geturl, function (str) { var data = _this.card(str); _this.build(data);

            }, function (a, c) {
                if (a.status == 404) {

                } else {
                    Lampa.Noty.show(network.errorDecode(a, c));
                }
            }, false, {
                dataType: 'text'
                } 
            });

and a.status can not return status code.

usmanec commented 6 months ago

error here

https://github.com/yumata/lampa-source/blob/4202279778eb3439b83c55c4c2c24473cf6229ac/src/utils/android.js#L87C1-L87C98

        if(!req.data.dataType || req.data.dataType && req.data.dataType.toLowerCase() == 'json'){
            try {
                resp = JSON.parse(resp)
            } 
            catch (e) {}
        }

lack of conditions callback === 'error' ||