mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Fix chain option search
If you're reading this commit history, please avert your eyes. 3 commits to fix this admittedly simple problem is more than my pride can handle. The `gun.Back()` function was only searching for `opt`, not `opt.file`. It would stop at the first mention of `opt` even if it didn't have settings for `file`. Now it won't.
This commit is contained in:
parent
e7162aa098
commit
f999e5f2ea
@ -12,12 +12,12 @@ function isUsingFileJS (context) {
|
||||
var methodOptions = context.opt || {};
|
||||
|
||||
// Options set on the gun chain.
|
||||
var chainOptions = context.gun.Back('opt') || {};
|
||||
var chainOption = context.gun.Back('opt.file');
|
||||
|
||||
// Favor method options over chain options.
|
||||
var file = methodOptions.hasOwnProperty('file')
|
||||
? methodOptions.file
|
||||
: chainOptions.file;
|
||||
: chainOption;
|
||||
|
||||
// Return whether the module is disabled.
|
||||
return file !== false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user