Skip to content

Commit

Permalink
fix: barcode sometimes missing
Browse files Browse the repository at this point in the history
Fixes #395
  • Loading branch information
arildm committed Sep 24, 2024
1 parent 95be674 commit 1f63b5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

- In the corpus selector, an empty folder would add 1 to the parent folder's corpus count
- Searching by pressing Enter in Simple search is broken [#394](https://github.com/spraakbanken/korp-frontend/issues/394)
- Barcode (aka hitsPicture) sometimes missing from KWIC tab [#395](https://github.com/spraakbanken/korp-frontend/issues/395)

## [9.7.1] - 2024-09-18

Expand Down
4 changes: 2 additions & 2 deletions app/scripts/backend/base-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ export default abstract class BaseProxy<R extends {} = {}> {
}
})

const stats = (this.progress / this.total) * 100

if (this.total == null && struct.progress_corpora && struct.progress_corpora.length) {
const tmp = $.map(struct["progress_corpora"], function (corpus) {
if (!corpus.length) {
Expand All @@ -145,6 +143,8 @@ export default abstract class BaseProxy<R extends {} = {}> {
this.total = _.reduce(tmp, (val1, val2) => val1 + val2, 0)
}

const stats = (this.progress / this.total) * 100

this.prev = e.target.responseText
return {
struct,
Expand Down
9 changes: 3 additions & 6 deletions app/scripts/controllers/kwic_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,8 @@ export class KwicCtrl implements IController {
const req = s.getProxy().makeRequest(
{ ajaxParams },
s.page,
(progressObj) => {
$timeout(() => s.onProgress(progressObj, isPaging))
},
(data) => {
$timeout(() => s.renderResult(data))
}
(progressObj) => $timeout(() => s.onProgress(progressObj, isPaging)),
(data) => $timeout(() => s.renderResult(data))
)
req.done((data) => {
$timeout(() => {
Expand Down Expand Up @@ -256,6 +252,7 @@ export class KwicCtrl implements IController {
}

s.renderCompleteResult = (data, isPaging) => {
s.renderResult(data)
s.loading = false
if ("ERROR" in data) return
if (!isPaging) {
Expand Down

0 comments on commit 1f63b5a

Please sign in to comment.