Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Include VisitType.RELOAD query type when re-visiting. #1825

Merged
merged 1 commit into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class HistoryStore constructor(val context: Context) {
storage.getDetailedVisits(0, excludeTypes = listOf(
VisitType.NOT_A_VISIT,
VisitType.REDIRECT_TEMPORARY,
VisitType.REDIRECT_PERMANENT,
VisitType.RELOAD))
VisitType.REDIRECT_PERMANENT))
}

fun recordVisit(aURL: String, visitType: VisitType) = GlobalScope.future {
Expand Down Expand Up @@ -90,7 +89,8 @@ class HistoryStore constructor(val context: Context) {
}

fun isInHistory(aURL: String): CompletableFuture<Boolean> = GlobalScope.future {
storage.getVisited(listOf(aURL)).isNotEmpty()
var result = storage.getVisited(listOf(aURL))
result.isNotEmpty() && result[0]
}

private fun notifyListeners() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1479,22 +1479,19 @@ public GeckoResult<Boolean> onVisited(@NonNull GeckoSession geckoSession, @NonNu
VisitType visitType;
if (isReload) {
visitType = VisitType.RELOAD;

} else {
if ((flags & VISIT_REDIRECT_SOURCE_PERMANENT) != 0) {
visitType = VisitType.REDIRECT_PERMANENT;

} else if ((flags & VISIT_REDIRECT_SOURCE) != 0) {
visitType = VisitType.REDIRECT_TEMPORARY;

} else {
visitType = VisitType.LINK;
}
}

SessionStore.get().getHistoryStore().deleteVisitsFor(url);
SessionStore.get().getHistoryStore().recordVisit(url, visitType);

SessionStore.get().getHistoryStore().deleteVisitsFor(url).thenAcceptAsync(result -> {
SessionStore.get().getHistoryStore().recordVisit(url, visitType);
});
return GeckoResult.fromValue(true);
}

Expand Down