Merge pull request #148 from ttshivers/fix_display_defaults

fix(defaults): fix display of default party pause and auto host settings
This commit is contained in:
Travis Shivers 2020-09-10 12:43:30 -05:00 committed by GitHub
commit 159eea25da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -69,8 +69,8 @@ export default {
roomId: getters.GET_ROOM,
password: getters.GET_PASSWORD,
desiredUsername: getters.GET_DISPLAY_USERNAME,
desiredPartyPausingEnabled: rootGetters.GET_CONFIG.default_party_pause_enabled,
desiredAutoHostEnabled: rootGetters.GET_CONFIG.default_auto_host_enabled,
desiredPartyPausingEnabled: getters.IS_PARTY_PAUSING_ENABLED,
desiredAutoHostEnabled: getters.IS_AUTO_HOST_ENABLED,
thumb: rootGetters['plex/GET_PLEX_USER'].thumb,
syncFlexibility: rootGetters['settings/GET_SYNCFLEXIBILITY'],
...joinPlayerData,
@ -156,6 +156,8 @@ export default {
commit('SET_SOCKET_ID', null);
commit('CLEAR_MESSAGES');
commit('SET_MESSAGES_USER_CACHE', {});
commit('SET_IS_PARTY_PAUSING_ENABLED', null);
commit('SET_IS_AUTO_HOST_ENABLED', null);
},
SEND_MESSAGE: async ({ dispatch, getters }, msg) => {

View File

@ -25,8 +25,13 @@ export default {
GET_ROOM: (state) => state.room,
GET_USERS: (state) => state.users,
GET_MESSAGES: (state) => state.messages,
IS_PARTY_PAUSING_ENABLED: (state) => state.isPartyPausingEnabled,
IS_AUTO_HOST_ENABLED: (state) => state.isAutoHostEnabled,
IS_PARTY_PAUSING_ENABLED: (state, getters, rootState, rootGetters) => state.isPartyPausingEnabled
?? rootGetters.GET_CONFIG.default_party_pause_enabled,
IS_AUTO_HOST_ENABLED: (state, getters, rootState, rootGetters) => state.isAutoHostEnabled
?? rootGetters.GET_CONFIG.default_auto_host_enabled,
GET_HOST_USER: (state, getters) => getters.GET_USER(getters.GET_HOST_ID),
AM_I_HOST: (state, getters) => getters.GET_HOST_ID === getters.GET_SOCKET_ID,