diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java index 1604569719e9..95f985cd22c3 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java @@ -10,6 +10,7 @@ import android.os.Handler; import android.os.Looper; import android.text.TextUtils; +import android.util.Log; import android.view.DragEvent; import android.view.Menu; import android.view.MenuInflater; @@ -824,6 +825,14 @@ public void handleOnBackPressed() { mEditorJetpackSocialViewModel.start(mSite, mEditPostRepository); customizeToolbar(); + + // only for testing + if (mEditPostRepository.hasPost()) { + RemotePostPayload payload = new RemotePostPayload(mEditPostRepository.getEditablePost(), mSite); + mDispatcher.dispatch(PostActionBuilder.newFetchPostAction(payload)); + } + + } private void customizeToolbar() { @@ -3741,6 +3750,12 @@ public void onPostChanged(OnPostChanged event) { RemotePreviewType.REMOTE_PREVIEW_WITH_REMOTE_AUTO_SAVE); } } + + //for testing only + mEditPostRepository.loadPostByLocalPostId(mEditPostRepository.getId()); + String dateCreated = Objects.requireNonNull(mEditPostRepository.getPost()).getDateCreated(); + Log.d("mytest","mEditPostRepository post getDbTimestamp = " + mEditPostRepository.getPost().getDbTimestamp()); + refreshEditorContent(); } private boolean isRemotePreviewingFromEditor() { diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/posts/PostFetcher.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/posts/PostFetcher.kt index b7178d74910d..6b12f04f17e0 100644 --- a/WordPress/src/main/java/org/wordpress/android/viewmodel/posts/PostFetcher.kt +++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/posts/PostFetcher.kt @@ -1,5 +1,6 @@ package org.wordpress.android.viewmodel.posts +import android.util.Log import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleOwner @@ -40,6 +41,7 @@ class PostFetcher constructor( // TODO: We should implement batch fetching when it's available in the API @Suppress("ForbiddenComment") fun fetchPosts(site: SiteModel, remoteItemIds: List) { + Log.d("mytest", "fetchPosts() called") remoteItemIds .filter { // ignore duplicate requests diff --git a/build.gradle b/build.gradle index 1d393ace05cd..379d9e033408 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ ext { automatticTracksVersion = '3.4.0' gutenbergMobileVersion = 'v1.112.0' wordPressAztecVersion = 'v2.0' - wordPressFluxCVersion = 'trunk-ed60798b4d96ec19863c74b0f525e2e20f4525db' + wordPressFluxCVersion = '2957-aae6270fa40e9142b97ab9c28ab376226450d2f2' wordPressLoginVersion = 'trunk-a90b1ce939aba700d822f188d41624385f9c1dce' wordPressPersistentEditTextVersion = '1.0.2' wordPressUtilsVersion = '3.13.0'