Explorar el Código

simplify mutation

pull/342/head
Guillaume Vincent hace 7 años
padre
commit
133c84f0f8
Se han modificado 1 ficheros con 1 adiciones y 6 borrados
  1. +1
    -6
      src/store/mutations.js

+ 1
- 6
src/store/mutations.js Ver fichero

@@ -42,23 +42,18 @@ export default {
if (!site || typeof state.password.id !== "undefined") {
return;
}
let siteMatch = false;
state.password = Object.assign({}, state.password, { site });
const passwords = state.passwords || [];
const siteWithoutWWW = site.replace(/^www./g, "");
for (let i = 0; i < passwords.length; i++) {
const password = passwords[i];
if (site.endsWith(password.site)) {
state.password = { ...password };
siteMatch = true;
break;
} else if (password.site.endsWith(siteWithoutWWW)) {
state.password = { ...password };
siteMatch = true;
}
}
if (site && !siteMatch) {
state.password = Object.assign({}, state.password, { site });
}
},
[types.SET_MESSAGE](state, { message }) {
state.message = message;


Cargando…
Cancelar
Guardar