Change: styles.order -> injectionOrder

This commit is contained in:
eight04 2021-12-30 16:30:36 +08:00
parent e2c0a4eca4
commit 0499df1039
3 changed files with 4 additions and 4 deletions

View File

@ -72,7 +72,7 @@ const styleMan = (() => {
} }
}); });
prefs.subscribe(['styles.order'], (key, value) => { prefs.subscribe(['injectionOrder'], (key, value) => {
order = {}; order = {};
value.forEach((uid, i) => { value.forEach((uid, i) => {
const id = uuidIndex.get(uid); const id = uuidIndex.get(uid);

View File

@ -21,7 +21,7 @@
const [item] = list.splice(e.detail.originalIndex, 1); const [item] = list.splice(e.detail.originalIndex, 1);
list.splice(e.detail.spliceIndex, 0, item); list.splice(e.detail.spliceIndex, 0, item);
ol.insertBefore(e.detail.dragTarget, e.detail.insertBefore); ol.insertBefore(e.detail.dragTarget, e.detail.insertBefore);
prefs.set('styles.order', list.map(l => l.style._id)); prefs.set('injectionOrder', list.map(l => l.style._id));
}); });
new DraggableList(ol, {scrollContainer: ol}); new DraggableList(ol, {scrollContainer: ol});
document.querySelector('#main').classList.add('ready'); document.querySelector('#main').classList.add('ready');
@ -49,7 +49,7 @@
uuidIndex.set(s._id, s); uuidIndex.set(s._id, s);
} }
const orderedStyles = []; const orderedStyles = [];
for (const uid of prefs.get('styles.order')) { for (const uid of prefs.get('injectionOrder')) {
const s = uuidIndex.get(uid); const s = uuidIndex.get(uid);
if (s) { if (s) {
uuidIndex.delete(uid); uuidIndex.delete(uid);

View File

@ -127,7 +127,7 @@
'updateInterval': 24, // user-style automatic update interval, hours (0 = disable) 'updateInterval': 24, // user-style automatic update interval, hours (0 = disable)
'styles.order': [], 'injectionOrder': [],
}; };
const knownKeys = Object.keys(defaults); const knownKeys = Object.keys(defaults);
/** @type {PrefsValues} */ /** @type {PrefsValues} */