fixing small issues in the project
This commit is contained in:
1 parent
032d2a100a
commit
99dbea0615
17 files changed
+166
-55
No files matched your search
@@ -40,7 +40,6 @@ const ClockTab: React.FC<ClockTabProps> = ({ config, onChange }) => {
|
||||
onChange={(e) => updateClock({ font: e.target.value as string })}
|
||||
options={[
|
||||
{ value: 'Helvetica', label: 'Helvetica' },
|
||||
{ value: `'Orbitron', sans-serif`, label: 'Orbitron' },
|
||||
{ value: 'monospace', label: 'Monospace' },
|
||||
{ value: 'cursive', label: 'Cursive' },
|
||||
]}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Config, Server } from '../../types';
|
||||
import RangeSlider from './RangeSlider';
|
||||
import { TrashIcon } from '../icons';
|
||||
import { createId } from '../utils/idUtils';
|
||||
import { parseServerAddress } from '../utils/urlUtils';
|
||||
|
||||
interface ServerWidgetTabProps {
|
||||
config: Config;
|
||||
@@ -21,6 +22,12 @@ const ServerWidgetTab: React.FC<ServerWidgetTabProps> = ({ config, onChange }) =
|
||||
|
||||
const handleAddServer = () => {
|
||||
if (newServerName.trim() === '' || newServerAddress.trim() === '') return;
|
||||
try {
|
||||
parseServerAddress(newServerAddress);
|
||||
} catch (error) {
|
||||
alert(error instanceof Error && error.message.startsWith('Server') ? error.message : 'Please enter a valid server address, e.g. 192.168.1.10:8080 or https://example.com.');
|
||||
return;
|
||||
}
|
||||
const newServer: Server = {
|
||||
id: createId(),
|
||||
name: newServerName.trim(),
|
||||
|
||||
@@ -121,7 +121,10 @@ const ThemeTab: React.FC<ThemeTabProps> = ({
|
||||
>
|
||||
<span className="truncate">{wallpaper.name}</span>
|
||||
<button
|
||||
onClick={() => onDeleteWallpaper(wallpaper)}
|
||||
onClick={() => {
|
||||
if (!wallpaper.url && !confirm(`Delete "${wallpaper.name}"? Uploaded wallpapers are not included in exports and cannot be recovered.`)) return;
|
||||
void onDeleteWallpaper(wallpaper);
|
||||
}}
|
||||
className="liquid-edit-action liquid-focus text-red-300 hover:text-red-100"
|
||||
aria-label={`Delete ${wallpaper.name}`}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user