diff --git a/lib/www/client/source/src/store/modules/user/actions.js b/lib/www/client/source/src/store/modules/user/actions.js index 38d0cff..459b115 100644 --- a/lib/www/client/source/src/store/modules/user/actions.js +++ b/lib/www/client/source/src/store/modules/user/actions.js @@ -56,11 +56,11 @@ function setCredentials ({state, commit, getters, dispatch}, {force, token} = {} * Save user preferences to localStorage and store. * * User preferences are identified by a key that gets - * prefixed with the user name and role. The value can + * prefixed with the user ID. The value can * be anything that JSON.stringify can parse. */ function saveUserPreference ({state, commit}, [key, value]) { - const k = `${state.user?.name}.${state.user?.role}.${key}`; + const k = `${state.user?.id}.${key}`; if (value !== undefined) { localStorage.setItem(k, JSON.stringify(value)); @@ -79,7 +79,7 @@ function saveUserPreference ({state, commit}, [key, value]) { async function loadUserPreferences ({state, commit}) { // Get all keys which are of interest to us - const prefix = `${state.user?.name}.${state.user?.role}`; + const prefix = `${state.user?.id}`; const keys = Object.keys(localStorage).filter( k => k.startsWith(prefix) ); // Build the preferences object