Update DropdownReflexer.vue

This commit is contained in:
Georges KABBOUCHI 2021-09-16 21:10:11 +03:00
parent 62333c5f51
commit 0670715351

View File

@ -23,7 +23,9 @@
<template #menu="{ close }"> <template #menu="{ close }">
<dropdown-menu style="width: 240px; max-height: 440px"> <dropdown-menu style="width: 240px; max-height: 440px">
<div class="flex flex-col overflow-x-hidden overflow-y-auto scrollbar-hover scrollbar"> <div
class="flex flex-col overflow-x-hidden overflow-y-auto scrollbar-hover scrollbar"
>
<button <button
v-for="safe in safes" v-for="safe in safes"
:key="safe.id" :key="safe.id"
@ -70,12 +72,18 @@ export default defineComponent({
}, },
setup() { setup() {
const router = useRouter() const router = useRouter()
const { safeId, safes, selectSafe, isNewSafe } = useReflexerPosition() const { safeId, safes, selectSafe, isNewSafe, safeType, safeTypes } = useReflexerPosition()
const { back } = useSidebar() const { back } = useSidebar()
function openNewSafe(cb) { function openNewSafe(cb) {
router.push({ hash: 'collateral' }) if (safeTypes.value.length === 1) {
safeType.value = safeTypes.value[0].type;
isNewSafe.value = true;
router.push({ hash: "supply" });
} else {
router.push({ hash: "collateral" });
}
cb(); cb();
} }