Prevents user prefs saving when changing to view modes that do not use fetchonly
This commit is contained in:
parent
443a65064b
commit
fa40ac7418
|
@ -943,15 +943,15 @@
|
|||
else if (metadatum.display == 'yes')
|
||||
display = true;
|
||||
|
||||
// // Deciding display based on user prefs
|
||||
// if (prefsFetchOnlyObject != undefined &&
|
||||
// prefsFetchOnlyObject.meta != undefined) {
|
||||
// let index = prefsFetchOnlyObject.meta.findIndex(metadatumId => metadatumId == metadatum.id);
|
||||
// if (index >= 0)
|
||||
// display = true;
|
||||
// else
|
||||
// display = false;
|
||||
// }
|
||||
// Deciding display based on user prefs
|
||||
if (prefsFetchOnlyObject != undefined &&
|
||||
prefsFetchOnlyObject.meta != undefined) {
|
||||
let index = prefsFetchOnlyObject.meta.findIndex(metadatumId => metadatumId == metadatum.id);
|
||||
if (index >= 0)
|
||||
display = true;
|
||||
else
|
||||
display = false;
|
||||
}
|
||||
|
||||
metadata.push({
|
||||
name: metadatum.name,
|
||||
|
@ -1045,7 +1045,7 @@
|
|||
'2': 'author_name',
|
||||
'3': 'title',
|
||||
'4': 'description'
|
||||
});
|
||||
}, true);
|
||||
|
||||
this.sortingMetadata.push({
|
||||
name: this.$i18n.get('label_title'),
|
||||
|
|
|
@ -189,14 +189,16 @@ export default {
|
|||
this.$store.dispatch('search/add_fetchonly_meta', metadatum );
|
||||
this.updateURLQueries();
|
||||
},
|
||||
addFetchOnly( metadatum ){
|
||||
addFetchOnly( metadatum, ignorePrefs ){
|
||||
this.$store.dispatch('search/add_fetchonly', metadatum );
|
||||
this.updateURLQueries();
|
||||
|
||||
let prefsFetchOnly = this.collectionId != undefined ? 'fetch_only_' + this.collectionId : 'fetch_only';
|
||||
if (JSON.stringify(this.$userPrefs.get(prefsFetchOnly)) != JSON.stringify(metadatum)) {
|
||||
this.$userPrefs.set(prefsFetchOnly, metadatum)
|
||||
.catch(() => { this.$console.log("Error setting user prefs for fetch_only"); });
|
||||
if (!ignorePrefs) {
|
||||
let prefsFetchOnly = this.collectionId != undefined ? 'fetch_only_' + this.collectionId : 'fetch_only';
|
||||
if (JSON.stringify(this.$userPrefs.get(prefsFetchOnly)) != JSON.stringify(metadatum)) {
|
||||
this.$userPrefs.set(prefsFetchOnly, metadatum)
|
||||
.catch(() => { this.$console.log("Error setting user prefs for fetch_only"); });
|
||||
}
|
||||
}
|
||||
},
|
||||
cleanFetchOnly() {
|
||||
|
|
Loading…
Reference in New Issue