Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A function "clearSelectTokenAddress" to reset to the fallback value for token addresses #1129

Open
hardingjam opened this issue Jan 8, 2025 · 0 comments
Assignees

Comments

@hardingjam
Copy link
Contributor

hardingjam commented Jan 8, 2025

<div class="mb-4 flex flex-col gap-2">
	<Label class="whitespace-nowrap text-xl">{token}</Label>
	<Input
		type="text"
		on:input={async ({ currentTarget }) => {
			if (currentTarget instanceof HTMLInputElement) {
				if (!gui) return;
				try {
					await gui.saveSelectTokenAddress(token, currentTarget.value);
					error = '';
					selectTokens = gui.getSelectTokens();
					gui = gui;
				} catch {
					error = 'Invalid address';
				}
			}
		}}
	/>
	{#if error}
// Handle invalid addresses by falling back to the default/fallback address?
		<p class="text-red-500">{error}</p>
	{/if}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants