Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/components/ActionsMenu.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<template>
<div
class="actions-menu"
:class="{ active: showMenu }"
@click="showMenu = true"
@keydown="showMenu = true"
>
<div class="actions-menu" :class="{ active: showMenu }" @click="handleOpen" @keydown="handleOpen">
<slot name="display" />
<SmallModal v-if="showMenu" @close="showMenu = false">
<slot />
Expand All @@ -19,11 +14,18 @@ export default {
components: {
SmallModal,
},
emits: ['open'],
data() {
return {
showMenu: false,
};
},
methods: {
handleOpen() {
if (!this.showMenu) this.$emit('open');
this.showMenu = true;
},
},
};
</script>

Expand Down
12 changes: 10 additions & 2 deletions src/components/InputAmount.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<template>
<div class="input-amount">
<slot name="left" />
<InputField type="number" v-bind="$attrs" @input="$emit('input', $event)" />
<InputField
type="number"
:value="value"
v-bind="$attrs"
@update:value="$emit('update:value', $event)"
/>
<slot name="right" />
</div>
</template>
Expand All @@ -13,7 +18,10 @@ export default {
components: {
InputField,
},
emits: ['input'],
props: {
value: { type: [String, Number], default: '' },
},
emits: ['update:value'],
};
</script>

Expand Down
4 changes: 2 additions & 2 deletions src/components/MainWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<div class="title">
{{ title }}
</div>
<div class="right" @click="settingsClickHandler" @keydown="settingsClickHandler">
<ActionsMenu v-if="settings">
<div class="right">
<ActionsMenu v-if="settings" @open="settingsClickHandler">
<template #display>
<Cog />
</template>
Expand Down
12 changes: 11 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,17 @@ export default createStore({
wallet,
lang,
aeternity: { providedLiquidity, slippage, deadline },
tokens: { userTokens, providers },
// Persist only lightweight provider metadata to avoid localStorage overflow.
// Do NOT persist large token lists; they are fetched on demand.
tokens: {
userTokens,
providers: (providers || []).map(({ name, icon, active }) => ({
name,
icon,
active,
tokens: [],
})),
},
hasSeenOnboarding,
}),
}),
Expand Down
5 changes: 5 additions & 0 deletions src/store/modules/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export default {
actions: {
async fetchAllTokens({ commit, rootGetters: { activeNetwork }, state: { providers } }) {
if (activeNetwork) {
const existingProvider = providers.find((p) => p.name === 'AE Middleware List');
const hasTokensForNetwork = existingProvider?.tokens?.some(
(t) => t.networkId === activeNetwork.networkId,
);
if (hasTokensForNetwork) return;
const tokens = await fetchAllPages(
() =>
fetchJson(`${activeNetwork.middlewareUrl}/v3/aex9?by=name&limit=100&direction=forward`),
Expand Down
Loading