Skip to content

Commit

Permalink
fix: simple search param url watch
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed Jan 23, 2025
1 parent 2cbcc4e commit eb2420e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions app/scripts/components/simple-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,15 @@ angular.module("korpApp").component("simpleSearch", {
}
})

// Reach to changes in URL params
$scope.$watch(
() => $location.search(),
(search) => {
ctrl.freeOrder = search.in_order != null
ctrl.prefix = search.prefix != null
ctrl.mid_comp = search.mid_comp != null
ctrl.suffix = search.suffix != null
ctrl.isCaseInsensitive = search.isCaseInsensitive != null
}
)
// React to changes in URL params
$scope.$on("$locationChangeSuccess", () => {
const search = $location.search()
ctrl.freeOrder = search.in_order != null
ctrl.prefix = search.prefix != null
ctrl.mid_comp = search.mid_comp != null
ctrl.suffix = search.suffix != null
ctrl.isCaseInsensitive = search.isCaseInsensitive != null
})

ctrl.onChange = (value, isPlain) => {
ctrl.currentText = isPlain ? value : undefined
Expand Down

0 comments on commit eb2420e

Please sign in to comment.