diff --git a/Clover/app/src/main/java/org/floens/chan/core/model/Loadable.java b/Clover/app/src/main/java/org/floens/chan/core/model/Loadable.java index ca2ccdb1..60331747 100644 --- a/Clover/app/src/main/java/org/floens/chan/core/model/Loadable.java +++ b/Clover/app/src/main/java/org/floens/chan/core/model/Loadable.java @@ -28,7 +28,7 @@ import com.j256.ormlite.table.DatabaseTable; @DatabaseTable public class Loadable { @DatabaseField(generatedId = true) - private int id; + public int id; @DatabaseField public int mode = Mode.INVALID; diff --git a/Clover/app/src/main/java/org/floens/chan/core/presenter/ThreadPresenter.java b/Clover/app/src/main/java/org/floens/chan/core/presenter/ThreadPresenter.java index 5ccf6aa5..208afae3 100644 --- a/Clover/app/src/main/java/org/floens/chan/core/presenter/ThreadPresenter.java +++ b/Clover/app/src/main/java/org/floens/chan/core/presenter/ThreadPresenter.java @@ -571,7 +571,10 @@ public class ThreadPresenter implements ChanLoader.ChanLoaderCallback, PostAdapt if (!historyAdded && ChanSettings.historyEnabled.get() && loadable.isThreadMode()) { historyAdded = true; History history = new History(); - history.loadable = loadable; + // Copy the loadable when adding to history + // Otherwise the database will possible use the loadable from a pin, and when clearing the history also deleting the loadable from the pin. + history.loadable = loadable.copy(); + history.loadable.id = 0; history.thumbnailUrl = chanLoader.getThread().op.thumbnailUrl; databaseManager.addHistory(history); }