Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
fix: first page as page=0 if {{page:0}} appears
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Jan 12, 2020
1 parent ba99e45 commit 9d797f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion static/files/js/omni-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,13 @@ app.controller("OmniController", function (
var provider = $scope.state.SearchProviders[$scope.inputs.provider];
if (!provider) return;
var origin = /(https?:\/\/[^\/]+)/.test(provider.url) && RegExp.$1;
var page = $scope.page;
if (/{{page:0}}/.test(provider.url)) {
page -= 1;
}

search
.all($scope.inputs.provider, $scope.inputs.omni, $scope.page)
.all($scope.inputs.provider, $scope.inputs.omni, page)
.success(function (results) {
if (!results || results.length === 0) {
$scope.noResults = true;
Expand Down

0 comments on commit 9d797f9

Please sign in to comment.