mutations.js 517 Bytes
import { setCookie, getCookie } from '@/utils/utils.js'
import { stat } from 'fs';

export function INCREMENT(state) {
	state.counter++
}

export function IS_MOBILE(state, bool) {
	state.isMobile = bool
}

export function IS_SMALL_SCREEN(state, bool) {
	state.isSmallScreen = bool
}

export function SET_USER_INFO(state, val) {
	if (val) {
		setCookie("_user_profile", encodeURIComponent(JSON.stringify(val)), 7200);
		state.userInfo = val;
	} else {
		setCookie("_user_profile", "", 1);
		state.userInfo = null;
	}
}