import { appSetting, indentifySetting } from '@/plugins/setting';

export const mutations = {
  SET_MENU_ACTIVE(state, value) {
    state.menuActive = value;
  },
  SET_APP_LOADING(state, value) {
    state.loading = value;
  },
  SET_APP_TITLE(state, title) {
    state.title = title;
  },
  SET_URL_CURRENT(state, url) {
    state.url = url;
  },
  SET_APP_EXTENSION_INFO(state, value) {
    appSetting.extensionInfo.set(value);
    state.extensionInfo = value;
  },
  SET_SHOP_PLATFORM_CONFIG(state, value) {
    appSetting.platformShopConfig.set(value);
    state.platformShopConfig = value;
  },
  /** @param {StateApp} state */
  SET_APP_INDENTIFY(state) {
    state.indentify.profileId = indentifySetting.profileId.get();
    state.indentify.agent = indentifySetting.browserAgent.get();
    state.indentify.browser = indentifySetting.browserName.get();
    state.indentify.ip = indentifySetting.browserIp.get();
    state.indentify.platform = indentifySetting.browserPlatform.get();
    state.indentify.fingerprint = indentifySetting.fingerprintId.get();
  },
};
