Skip to content

Commit

Permalink
fix: onDateCleared goes to latest and starts refresh
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Schmidt <[email protected]>
  • Loading branch information
Sheng-Long committed Mar 12, 2024
1 parent de233c2 commit 9459259
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
14 changes: 3 additions & 11 deletions src/components/DateTimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<template>
<div class="is-flex is-align-items-center">
<Datepicker v-model="date" placeholder="SELECT A DATE" :is-24="false" time-picker-inline dark @closed="handleClosed" @cleared="handleCleared"/>
<Datepicker v-model="date" placeholder="SELECT A DATE" :is-24="false" time-picker-inline dark @closed="handleClosed" @cleared="$emit('dateCleared')"/>
</div>
</template>

Expand All @@ -49,6 +49,8 @@ export default defineComponent({
controller: Object as PropType<TransactionTableControllerXL>
},

emits: ["dateCleared"],

setup(props) {
const date = ref(new Date())
const handleClosed = () => {
Expand All @@ -62,19 +64,9 @@ export default defineComponent({
console.log("Ignoring click because props.controller is undefined")
}
}
const handleCleared = () => {
if (props.controller) {
const controller = props.controller
controller.startAutoRefresh()
} else {
console.log("Ignoring click because props.controller is undefined")
}
}


return {
handleClosed,
handleCleared,
date
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/pages/AccountDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
<template v-slot:control>
<div v-if="selectedTab === 'transactions'" class="is-flex is-align-items-flex-end">
<PlayPauseButton v-if="timeSelection == 'LATEST'" :controller="transactionTableController"/>
<DateTimePicker v-else :controller="transactionTableController"/>
<DateTimePicker v-else :controller="transactionTableController" @dateCleared="onDateCleared"/>
<o-field style="margin-bottom: 0">
<o-select v-model="timeSelection" class="ml-2 h-is-text-size-1">
<option value="LATEST" @click="onLatest">LATEST</option>
Expand Down Expand Up @@ -381,6 +381,11 @@ export default defineComponent({
transactionTableController.stopAutoRefresh()
}

function onDateCleared() {
timeSelection.value = "LATEST"
onLatest()
}

//
// account
//
Expand Down Expand Up @@ -503,7 +508,8 @@ export default defineComponent({
filterVerified,
timeSelection,
onLatest,
onJump
onJump,
onDateCleared
}
}
});
Expand Down

0 comments on commit 9459259

Please sign in to comment.