Skip to content

Open source personal finance application

chore(TrnForm): clean up

ilkome3d640e4d4847
diff --git a/components/trnForm/TrnForm.vue b/components/trnForm/TrnForm.vue
index f2abee35..62827061 100644
--- a/components/trnForm/TrnForm.vue
+++ b/components/trnForm/TrnForm.vue
@@ -104,7 +104,6 @@ watch(() => props.show, (value) => {
/**
* Amounts
*/
-const amountType = computed(() => $store.state.trnForm.values.amountType)
const isTransfer = computed(() => $store.state.trnForm.values.amountType === 2)
/**
diff --git a/components/trnForm/useTrnFormValidate.ts b/components/trnForm/useTrnFormValidate.ts
index 7acf11a8..75e490de 100644
--- a/components/trnForm/useTrnFormValidate.ts
+++ b/components/trnForm/useTrnFormValidate.ts
@@ -1,3 +1,4 @@
+// TODO: translate
export default function useTrnFormValidate() {
function validate(values: any) {
const errorTitle = '😮'
diff --git a/store/trnForm/actions.js b/store/trnForm/actions.js
index 54c891eb..63f8d69b 100644
--- a/store/trnForm/actions.js
+++ b/store/trnForm/actions.js
@@ -8,16 +8,15 @@ export default {
})
},
- openTrnForm({ rootState, rootGetters, commit }, { action, trnId, isPc }) {
- isPc
- ? commit('openTrnFormPc')
- : commit('openTrnForm')
+ openTrnForm({ rootState, rootGetters, commit }, { action, trnId }) {
+ commit('openTrnForm')
+ const lastTrn = rootState.trns.items[rootGetters['trns/lastCreatedTrnId']]
+ console.log(rootGetters['trns/lastCreatedTrnId'], lastTrn)
switch (action) {
case 'create':
// get data from last trn
- if (rootGetters['trns/hasTrns'] && rootState.trns.items[rootGetters['trns/lastCreatedTrnId']]) {
- const lastTrn = rootState.trns.items[rootGetters['trns/lastCreatedTrnId']]
+ if (lastTrn) {
commit('setTrnFormValues', {
amount: '0',
amountType: 0,
@@ -72,8 +71,6 @@ export default {
incomeWalletAmount: trn.incomeWalletAmount || trn.amount,
incomeWalletId: trn.incomeWalletId || trn.walletFromId,
})
-
- console.log(trn)
}
// Simple
else {
diff --git a/store/trnForm/index.js b/store/trnForm/index.js
index 4061f4c8..49adb49c 100644
--- a/store/trnForm/index.js
+++ b/store/trnForm/index.js
@@ -16,7 +16,6 @@ export const state = () => ({
},
show: false,
- showPc: true,
showModalCategoryId: null,
showModalTrnId: null,
diff --git a/store/trnForm/mutations.js b/store/trnForm/mutations.js
index 1eddaae7..ca88c788 100644
--- a/store/trnForm/mutations.js
+++ b/store/trnForm/mutations.js
@@ -35,7 +35,6 @@ export default {
},
openTrnForm(state) { state.show = true },
- openTrnFormPc(state) { state.showPc = true },
toggleTrnForm(state) {
state.show = !state.show