mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: custom shortcuts
This commit is contained in:
parent
78d90f15f5
commit
e54c606c6d
9 changed files with 439 additions and 56 deletions
|
|
@ -8,6 +8,21 @@ const updateSetting = () => {
|
|||
...parsedSettings,
|
||||
};
|
||||
|
||||
if (
|
||||
settings.shortcuts.length !== initLocalStorage.settings.shortcuts.length
|
||||
) {
|
||||
// 当新增 shortcuts 时
|
||||
const oldShortcutsId = settings.shortcuts.map(s => s.id);
|
||||
const newShortcutsId = initLocalStorage.settings.shortcuts.filter(
|
||||
s => oldShortcutsId.includes(s.id) === false
|
||||
);
|
||||
newShortcutsId.map(id => {
|
||||
settings.shortcuts.push(
|
||||
initLocalStorage.settings.shortcuts.find(s => s.id === id)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
localStorage.setItem('settings', JSON.stringify(settings));
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue