mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-13 06:22:09 -04:00
Fix undefined this
This commit is contained in:
parent
dd104ef642
commit
f11bf21fdc
@ -796,7 +796,7 @@ ZIMArchive.prototype.getUtf8FromData = function (data) {
|
|||||||
* @return {Promise<DirEntry>} A Promise that resolves to a Directory Entry, or null if not found.
|
* @return {Promise<DirEntry>} A Promise that resolves to a Directory Entry, or null if not found.
|
||||||
*/
|
*/
|
||||||
ZIMArchive.prototype.getDirEntryByPath = function (path, zimitResolving, originalPath, followRedirects) {
|
ZIMArchive.prototype.getDirEntryByPath = function (path, zimitResolving, originalPath, followRedirects) {
|
||||||
var that = this;
|
var that = this || appstate.selectedArchive;
|
||||||
if (that.zimType === 'zimit' && (!appstate.isReplayWorkerAvailable || followRedirects)) {
|
if (that.zimType === 'zimit' && (!appstate.isReplayWorkerAvailable || followRedirects)) {
|
||||||
if (originalPath) appstate.originalPath = originalPath;
|
if (originalPath) appstate.originalPath = originalPath;
|
||||||
path = path.replace(/\?kiwix-display/, '');
|
path = path.replace(/\?kiwix-display/, '');
|
||||||
@ -812,7 +812,7 @@ ZIMArchive.prototype.getDirEntryByPath = function (path, zimitResolving, origina
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return util.binarySearch(0, this.file.entryCount, function (i) {
|
return util.binarySearch(0, that.file.entryCount, function (i) {
|
||||||
return that.file.dirEntryByUrlIndex(i).then(function (dirEntry) {
|
return that.file.dirEntryByUrlIndex(i).then(function (dirEntry) {
|
||||||
var url = dirEntry.namespace + '/' + dirEntry.url;
|
var url = dirEntry.namespace + '/' + dirEntry.url;
|
||||||
if (path < url) {
|
if (path < url) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user