fix disabled sponsorpost

This commit is contained in:
gdlbo
2024-02-20 01:57:07 +03:00
parent dbdf5469f5
commit baa3afc378
2 changed files with 3 additions and 2 deletions
@@ -7,6 +7,7 @@ import com.vk.dto.newsfeed.entries.Post;
import com.vk.newsfeed.NewsEntryActionsAdapter;
import com.vk.newsfeed.holders.AdMarkHolder;
import ru.vtosters.lite.utils.AccountManagerUtils;
import ru.vtosters.sponsorpost.utils.PostsPreferences;
public class PostsMenuHook {
private static final int id = 200;
@@ -15,7 +16,7 @@ public class PostsMenuHook {
if (newsEntry instanceof Post) {
int ownerId = ((Post) newsEntry).b();
if (ownerId != AccountManagerUtils.getUserId()) {
if (ownerId != AccountManagerUtils.getUserId() && PostsPreferences.isEnabled()) {
actionsAdapter.a(id, "SponsorPost");
}
}
@@ -107,7 +107,7 @@ public class SponsorPostFragment extends TrackedMaterialPreferenceToolbarFragmen
PostsPreferences.setEnabledMarking((boolean) o);
return true;
}
);
).setEnabled(PostsPreferences.isEnabled());
PreferenceFragmentUtils.addMaterialSwitchPreference(
getPreferenceScreen(),