Skip to content
Snippets Groups Projects
Commit 42c271b5 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

fix access check

parent 11c623fc
No related branches found
No related tags found
1 merge request!6152Start functions in app.data
......@@ -241,7 +241,7 @@ App.UI.Wardrobe.shoes = function(slave) {
// Options
let links = document.createElement('div');
links.className = "choices";
links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "shoes", slave));
links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "shoes", slave, false));
el.appendChild(links);
return jQuery('#shoes').empty().append(el);
......@@ -343,7 +343,7 @@ App.UI.Wardrobe.bellyAccessory = function(slave) {
// Options
let links = document.createElement('div');
links.className = "choices";
links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "bellyAccessory", slave));
links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "bellyAccessory", slave, false));
el.appendChild(links);
return jQuery('#bellyAccessory').empty().append(el);
......@@ -401,7 +401,7 @@ App.UI.Wardrobe.buttplug = function(slave) {
// Options
let links = document.createElement('div');
links.className = "choices";
links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "buttplug", slave));
links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "buttplug", slave, false));
el.appendChild(links);
return jQuery('#buttplug').empty().append(el);
......@@ -461,14 +461,14 @@ App.UI.Wardrobe.buttplugAttachment = function(slave) {
// Options
let links = document.createElement('div');
links.className = "choices";
links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "buttplugAttachment", slave));
links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "buttplugAttachment", slave, false));
el.appendChild(links);
return jQuery('#buttplugAttachment').empty().append(el);
};
App.UI.Wardrobe.generateRows = function(array, category, slave, ignoreAccessCheck="false") { // category should be in the form of slave.category, the thing we want to update.
App.UI.Wardrobe.generateRows = function(array, category, slave, ignoreAccessCheck=false) { // category should be in the form of slave.category, the thing we want to update.
let row = document.createElement('span');
for (let i = 0; i < array.length; i++) {
let link;
......@@ -486,9 +486,9 @@ App.UI.Wardrobe.generateRows = function(array, category, slave, ignoreAccessChec
}
}
// Some items will never be in App.data.misc, especially "none" if it falls in between harsh and nice data sets. Trying to look it up would cause an error, which is what access check works around.
let unlocked;
let unlocked = false;
if (ignoreAccessCheck === false) {
unlocked = isClothingAccessible.entry(array[i].updateSlave[category], `${category}`, slave);
unlocked = isClothingAccessible.entry(array[i].updateSlave[category], `${category}`, slave, false);
}
if (ignoreAccessCheck === true || unlocked) {
// is it just text?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment