fixing small issues in the project
Build and Release to Staging / Build Vision Start (push) Successful in 40s
Build and Release to Staging / Build Vision Start Image (push) Successful in 1m8s
Build and Release to Staging / Deploy Vision Start (staging) (push) Successful in 16s

This commit is contained in:
ivanch committed 2026-10-10 23:25:20 -03:00
1 parent 032d2a100a
commit 99dbea0615
17 files changed
+166 -55

No files matched your search

+12 -1
View File
@@ -1,6 +1,7 @@
import { useState, useEffect, useRef } from 'react';
import { Website } from '../types';
import { getWebsiteIcon } from './utils/iconService';
import { normalizeWebsiteUrl } from './utils/urlUtils';
import ModalShell from './ModalShell';
interface WebsiteEditModalProps {
@@ -98,6 +99,15 @@ const WebsiteEditModal: React.FC<WebsiteEditModalProps> = ({ website, edit, onCl
}
}, [iconQuery, iconMetadata]);
const handleSave = () => {
const normalizedUrl = normalizeWebsiteUrl(url);
if (!normalizedUrl) {
alert('Please enter a valid website URL (http, https, ftp, or mailto).');
return;
}
onSave({ id: website?.id, name: name.trim(), url: normalizedUrl, icon });
};
const fetchIcon = async () => {
if (url) {
const fetchedIcon = await getWebsiteIcon(url);
@@ -110,7 +120,8 @@ const WebsiteEditModal: React.FC<WebsiteEditModalProps> = ({ website, edit, onCl
title={edit ? 'Edit Website' : 'Add Website'}
edit={edit}
onClose={onClose}
onSave={() => onSave({ id: website?.id, name, url, icon })}
onSave={handleSave}
canSave={name.trim() !== '' && url.trim() !== ''}
onDelete={edit ? onDelete : undefined}
>
<div className="flex justify-center mb-4">