fix:修复动态上传失败后非主线程更新UI问题

This commit is contained in:
Max
2024-04-03 10:29:06 +08:00
parent beb083c896
commit 7bd8b4c653
2 changed files with 5 additions and 2 deletions

View File

@@ -68,6 +68,7 @@ public class PublishPresenter extends BaseMvpPresenter<IPublishView> {
public void acceptThrowable(String s, Throwable throwable) {
super.acceptThrowable(s, throwable);
if (throwable != null) {
throwable.printStackTrace();
dealUploadFileError(throwable);
} else {
if (getMvpView() != null) {
@@ -134,11 +135,13 @@ public class PublishPresenter extends BaseMvpPresenter<IPublishView> {
.flatMap((Function<String, SingleSource<String>>)
path -> FileModel.get().uploadFile(path))
.compose(bindUntilEvent(PresenterEvent.DESTROY))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new DontWarnObserver<String>() {
@Override
public void acceptThrowable(String url, Throwable throwable) {
super.acceptThrowable(url, throwable);
if (throwable != null) {
throwable.printStackTrace();
if (mImageUploadSubscribe != null) {
mImageUploadSubscribe.dispose();
}

View File

@@ -31,8 +31,8 @@ COMPILE_SDK_VERSION=33
MIN_SDK_VERSION=21
TARGET_SDK_VERSION=33
version_name=2.6.5
version_code=2605
version_name=2.6.6
version_code=2606
#systemProp.https.proxyHost=127.0.0.1
#systemProp.https.proxyPort=7890