diff --git a/src/api/focus/layernames.js b/src/api/focus/layernames.js index 864746dbe..991c71f52 100644 --- a/src/api/focus/layernames.js +++ b/src/api/focus/layernames.js @@ -29,15 +29,11 @@ export default class LayerNames { const data = await s.request("keymap.layerNames"); if (!data) return { storageSize: 0, names: [] }; - const storageSize = data - .split(/\n/) - .map((x) => x.split(/^(\d+) /).slice(1)) - .pop()[1] - .split(/=/) - .pop(); + const names = data.split(/\n/).map((x) => x.split(/^(\d+) /).slice(1)); + const storageSize = names.pop()[1].split(/=/).pop(); return { storageSize: parseInt(storageSize), - names: data.map((x) => x[1]), + names: names.map((x) => x[1]), }; }