Quellcode durchsuchen

load site directly on password generator component

pull/342/head
Guillaume Vincent vor 7 Jahren
Ursprung
Commit
ecbac671f0
2 geänderte Dateien mit 6 neuen und 14 gelöschten Zeilen
  1. +2
    -12
      src/store/actions.js
  2. +4
    -2
      src/views/PasswordGenerator.vue

+ 2
- 12
src/store/actions.js Datei anzeigen

@@ -16,10 +16,8 @@ export const saveDefaultOptions = ({ commit }, payload) => {
commit(types.SET_DEFAULT_OPTIONS, payload); commit(types.SET_DEFAULT_OPTIONS, payload);
}; };


export const loadBestPasswordProfile = ({ commit }) => {
urlParser.getSite().then(site => {
commit(types.LOAD_PASSWORD_PROFILE, { site });
});
export const loadPasswordProfile = ({ commit }, { site }) => {
commit(types.LOAD_PASSWORD_PROFILE, { site });
}; };


export const getPasswordFromUrlQuery = ({ commit }, { query }) => { export const getPasswordFromUrlQuery = ({ commit }, { query }) => {
@@ -37,14 +35,6 @@ export const resetPassword = ({ commit, state }) => {
commit(types.RESET_PASSWORD); commit(types.RESET_PASSWORD);
}; };


export const getSite = ({ commit }) => {
urlParser.getSite().then(site => {
if (site) {
commit(types.SET_SITE, { site });
}
});
};

export const login = ({ commit }, payload) => { export const login = ({ commit }, payload) => {
commit(types.SET_BASE_URL, payload); commit(types.SET_BASE_URL, payload);
commit(types.SET_TOKEN, payload); commit(types.SET_TOKEN, payload);


+ 4
- 2
src/views/PasswordGenerator.vue Datei anzeigen

@@ -120,6 +120,7 @@
import {showTooltip} from '../services/tooltip'; import {showTooltip} from '../services/tooltip';
import message from '../services/message'; import message from '../services/message';
import Awesomplete from 'awesomplete'; import Awesomplete from 'awesomplete';
import * as urlParser from "../services/url-parser";


export default { export default {
name: 'password-generator-view', name: 'password-generator-view',
@@ -136,8 +137,9 @@
this.$store this.$store
.dispatch('getPasswords') .dispatch('getPasswords')
.then(() => { .then(() => {
this.$store.dispatch('loadBestPasswordProfile');
this.$store.dispatch('getSite');
urlParser.getSite().then(site => {
this.$store.dispatch('loadPasswordProfile', {site});
});
this.$store.dispatch('getPasswordFromUrlQuery', {query: this.$route.query}); this.$store.dispatch('getPasswordFromUrlQuery', {query: this.$route.query});
}); });
}, },


Laden…
Abbrechen
Speichern