UNPKG

@empathyco/x-components

Version:
19 lines (16 loc) 770 B
import { localStorageService } from '../../../../utils/storage.js'; import { SESSION_TIME_STAMP_STORAGE_KEY } from '../constants.js'; /** * Default implementation for the {@link HistoryQueriesActions.refreshSession}. * * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions, * provided by Vuex. * @public */ const refreshSession = ({ state, commit, }) => { const sessionTimeStampInMs = localStorageService.getItem(SESSION_TIME_STAMP_STORAGE_KEY) ?? Date.now(); localStorageService.setItem(SESSION_TIME_STAMP_STORAGE_KEY, sessionTimeStampInMs, state.config.sessionTTLInMs); commit('setSessionTimeStamp', sessionTimeStampInMs); }; export { refreshSession }; //# sourceMappingURL=refresh-session.action.js.map