Skip to content
Open
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function(options, iframely_options, callback) {

var prefix = CONFIG.API_REQUEST_CACHE_PREFIX ? (CONFIG.API_REQUEST_CACHE_PREFIX + ':') : '';

var lang = iframely_options.getProviderOptions('locale');
var lang = iframely_options?.getProviderOptions('locale');
if (lang) {
prefix += lang + ':';
}
Expand All @@ -94,13 +94,13 @@ export default function(options, iframely_options, callback) {
}

if (error) {
iframely_options.registerFetchError({
iframely_options?.registerFetchError({
source: 'api',
url: options.uri,
error: error
});
} else if (result && result.status !== 200) {
iframely_options.registerFetchError({
iframely_options?.registerFetchError({
source: 'api',
url: options.uri,
status_code: result.status
Expand Down Expand Up @@ -153,7 +153,7 @@ export default function(options, iframely_options, callback) {
});
}

iframely_options.registerFetch({
iframely_options?.registerFetch({
source: 'api',
url: options.uri
});
Expand All @@ -171,7 +171,7 @@ export default function(options, iframely_options, callback) {
}

// Ignore proxy.cache_ttl, if options.cache_ttl === 0 - do not read from cache.
if (iframely_options.cache_ttl === 0) {
if (iframely_options?.cache_ttl === 0) {

if (useCacheOnly) {

Expand All @@ -197,7 +197,7 @@ export default function(options, iframely_options, callback) {
}
}

iframely_options.registerFetch({
iframely_options?.registerFetch({
source: 'cache',
url: options.uri
});
Expand Down
Loading