2021-11-22 09:35:29 +00:00
|
|
|
import { SET_REFERRER_HOST, SET_WIDGET_COLOR } from '../types';
|
2019-11-25 18:40:27 +00:00
|
|
|
|
|
|
|
const state = {
|
|
|
|
widgetColor: '',
|
2021-11-22 09:35:29 +00:00
|
|
|
referrerHost: '',
|
2019-11-25 18:40:27 +00:00
|
|
|
};
|
|
|
|
|
2021-11-22 09:35:29 +00:00
|
|
|
export const getters = {
|
2019-11-25 18:40:27 +00:00
|
|
|
getWidgetColor: $state => $state.widgetColor,
|
2021-11-22 09:35:29 +00:00
|
|
|
getReferrerHost: $state => $state.referrerHost,
|
2019-11-25 18:40:27 +00:00
|
|
|
};
|
|
|
|
|
2021-11-22 09:35:29 +00:00
|
|
|
export const actions = {
|
2019-11-25 18:40:27 +00:00
|
|
|
setWidgetColor({ commit }, data) {
|
|
|
|
commit(SET_WIDGET_COLOR, data);
|
|
|
|
},
|
2021-11-22 09:35:29 +00:00
|
|
|
setReferrerHost({ commit }, referrerHost) {
|
|
|
|
commit(SET_REFERRER_HOST, referrerHost);
|
|
|
|
},
|
2019-11-25 18:40:27 +00:00
|
|
|
};
|
|
|
|
|
2021-11-22 09:35:29 +00:00
|
|
|
export const mutations = {
|
2019-11-25 18:40:27 +00:00
|
|
|
[SET_WIDGET_COLOR]($state, data) {
|
2020-04-19 18:10:28 +00:00
|
|
|
$state.widgetColor = data.widgetColor;
|
2019-11-25 18:40:27 +00:00
|
|
|
},
|
2021-11-22 09:35:29 +00:00
|
|
|
[SET_REFERRER_HOST]($state, referrerHost) {
|
|
|
|
$state.referrerHost = referrerHost;
|
|
|
|
},
|
2019-11-25 18:40:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
namespaced: true,
|
|
|
|
state,
|
|
|
|
getters,
|
|
|
|
actions,
|
|
|
|
mutations,
|
|
|
|
};
|