Quellcode durchsuchen

simplify mutation

pull/342/head
Guillaume Vincent vor 7 Jahren
Ursprung
Commit
133c84f0f8
1 geänderte Dateien mit 1 neuen und 6 gelöschten Zeilen
  1. +1
    -6
      src/store/mutations.js

+ 1
- 6
src/store/mutations.js Datei anzeigen

@@ -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;


Laden…
Abbrechen
Speichern