cancel all on toolbar / disable
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
<template>
|
||||
<toolbar-pane title="Status" icon="mdi-format-list-bulleted-square">
|
||||
<template #toolbar>
|
||||
<v-btn variant="text" v-if="s.vault" prepend-icon="mdi-delete-alert" color="red"
|
||||
@click="cancelAll(s.vault)" :disabled="!anyOrdersOpen"
|
||||
text="Cancel All"/>
|
||||
</template>
|
||||
<needs-signer>
|
||||
<orders/>
|
||||
</needs-signer>
|
||||
@@ -11,6 +16,21 @@
|
||||
import ToolbarPane from "@/components/chart/ToolbarPane.vue";
|
||||
import Orders from "@/components/Status.vue";
|
||||
import NeedsSigner from "@/components/NeedsSigner.vue";
|
||||
import {cancelAll} from "@/blockchain/wallet.js";
|
||||
import {useStore} from "@/store/store.js";
|
||||
import {computed} from "vue";
|
||||
import {isOpen} from "@/blockchain/orderlib.js";
|
||||
|
||||
const s = useStore()
|
||||
|
||||
const anyOrdersOpen = computed(()=>{
|
||||
console.log('vo', s.vaultOrders)
|
||||
for ( const order of Object.values(s.vaultOrders) )
|
||||
if ( isOpen(order.state) )
|
||||
return true
|
||||
return false
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user