mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 11:04:00 +00:00
Allow old misspelled option to still work
This commit is contained in:
parent
fc653cfcb2
commit
2d905f55c1
2 changed files with 13 additions and 5 deletions
|
|
@ -1,3 +1,7 @@
|
|||
## (next version)
|
||||
|
||||
* Deprecated: The misspelled `Winamp` construction option `avaliableSkins` has been deprecated in favor of `availableSkins`. `avaliableSkins` will continue to work, but will log a deprecation warning. [#533](https://github.com/captbaritone/winamp2-js/pull/533) by [@remigallego](https://github.com/remigallego)
|
||||
|
||||
## 0.0.6
|
||||
|
||||
* Added: `winamp.appendTracks()`.
|
||||
|
|
|
|||
14
js/winamp.js
14
js/winamp.js
|
|
@ -45,6 +45,7 @@ class Winamp {
|
|||
this.options = options;
|
||||
const {
|
||||
initialTracks,
|
||||
avaliableSkins, // Old misspelled name
|
||||
availableSkins,
|
||||
enableHotkeys = false
|
||||
} = this.options;
|
||||
|
|
@ -67,11 +68,14 @@ class Winamp {
|
|||
if (initialTracks) {
|
||||
this.appendTracks(initialTracks);
|
||||
}
|
||||
if (availableSkins) {
|
||||
this.store.dispatch({
|
||||
type: SET_AVAILABLE_SKINS,
|
||||
skins: availableSkins
|
||||
});
|
||||
|
||||
if (avaliableSkins != null) {
|
||||
console.warn(
|
||||
"The misspelled option `avaliableSkins` is deprecated. Please use `availableSkins` instead."
|
||||
);
|
||||
this.store.dispatch({ type: SET_AVAILABLE_SKINS, skins: avaliableSkins });
|
||||
} else {
|
||||
this.store.dispatch({ type: SET_AVAILABLE_SKINS, skins: availableSkins });
|
||||
}
|
||||
|
||||
if (enableHotkeys) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue