Migrate me from null to undefined, prevents corrupted state

This commit is contained in:
James Barnsley
2020-11-30 20:10:17 +13:00
parent a6869b16aa
commit eea495cb17

View File

@ -1,7 +1,13 @@
export default (state) => {
if (state.ui.shortkeys_enabled !== undefined) {
state.ui.hotkeys_enabled = state.ui.shortkeys_enabled;
}
// Change authorizations from 'null' to 'undefined' to fix destructuring issues like
// that of https://github.com/jaedb/Iris/issues/662
if (state.spotify && state.spotify.me === null) state.spotify.me = undefined;
if (state.lastfm && state.lastfm.me === null) state.lastfm.me = undefined;
if (state.genius && state.genius.me === null) state.genius.me = undefined;
return state;
};