Skip to content

Commit

Permalink
feat: add group valid start in the store state
Browse files Browse the repository at this point in the history
Signed-off-by: Svetoslav Borislavov <[email protected]>
  • Loading branch information
SvetBorislavov committed Jan 14, 2025
1 parent 09385ad commit 791d1f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const transactionGroupProcessor = ref<typeof TransactionGroupProcessor | null>(n
const file = ref<HTMLInputElement | null>(null);
const wantToDeleteModalShown = ref(false);
const showAreYouSure = ref(false);
const groupValidStart = ref(new Date());
const groupEmpty = computed(() => transactionGroup.groupItems.length == 0);
Expand Down Expand Up @@ -157,7 +156,7 @@ async function handleSignSubmit() {
}
try {
transactionGroup.updateTransactionValidStarts(groupValidStart.value);
transactionGroup.updateTransactionValidStarts(transactionGroup.groupValidStart);
const ownerKeys = new Array<PublicKey>();
for (const key of user.keyPairs) {
ownerKeys.push(PublicKey.fromString(key.public_key));
Expand Down Expand Up @@ -296,7 +295,7 @@ async function handleOnFileChanged(e: Event) {
}
function updateGroupValidStart(newDate: Date) {
groupValidStart.value = newDate;
transactionGroup.groupValidStart = newDate;
}
/* Functions */
Expand Down Expand Up @@ -438,9 +437,9 @@ onBeforeRouteLeave(async to => {
>Group Valid Start <span class="text-muted text-italic">- Local time</span></label
>
<RunningClockDatePicker
v-model="groupValidStart"
:nowButtonVisible="true"
:model-value="transactionGroup.groupValidStart"
@update:modelValue="updateGroupValidStart"
:nowButtonVisible="true"
/>
</div>
<div>
Expand Down
3 changes: 3 additions & 0 deletions front-end/src/renderer/stores/storeTransactionGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface GroupItem {
const useTransactionGroupStore = defineStore('transactionGroup', () => {
/* State */
const groupItems = ref<GroupItem[]>([]);
const groupValidStart = ref(new Date());
const description = ref('');
const sequential = ref(false);
const modified = ref(false);
Expand Down Expand Up @@ -73,6 +74,7 @@ const useTransactionGroupStore = defineStore('transactionGroup', () => {

function clearGroup() {
groupItems.value = [];
groupValidStart.value = new Date();
description.value = '';
sequential.value = false;
modified.value = false;
Expand Down Expand Up @@ -265,6 +267,7 @@ const useTransactionGroupStore = defineStore('transactionGroup', () => {
clearGroup,
groupItems,
description,
groupValidStart,
sequential,
getRequiredKeys,
editGroupItem,
Expand Down

0 comments on commit 791d1f0

Please sign in to comment.