mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-03 07:57:22 +00:00
Fix ESLint errors: remove unused NPool import, fix useEffect dependencies
This commit is contained in:
2 files changed
+12
-5
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { AlertCircle, Globe, Tag } from 'lucide-react';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Input } from '@/components/ui/input';
|
||||
@@ -39,15 +39,22 @@ export function NsiteDeployForm({
|
||||
// On mount: sync all saved values to parent and set defaults.
|
||||
// The component is keyed by selectedProviderId in DeploySteps, so this always
|
||||
// runs with fresh props — no initialized guard needed.
|
||||
useEffect(() => {
|
||||
const initializedRef = useRef(false);
|
||||
const stableSyncToParent = useCallback(() => {
|
||||
if (initializedRef.current) return;
|
||||
initializedRef.current = true;
|
||||
|
||||
if (savedSiteType) onSiteTypeChange(savedSiteType);
|
||||
if (savedSiteDescription) onSiteDescriptionChange(savedSiteDescription);
|
||||
|
||||
const initialTitle = savedSiteTitle ?? (siteType === 'named' ? projectName : '');
|
||||
if (initialTitle !== siteTitle) setSiteTitle(initialTitle);
|
||||
onSiteTitleChange(initialTitle);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
}, [savedSiteType, savedSiteDescription, savedSiteTitle, siteType, siteTitle, projectName, onSiteTypeChange, onSiteDescriptionChange, onSiteTitleChange]);
|
||||
|
||||
useEffect(() => {
|
||||
stableSyncToParent();
|
||||
}, [stableSyncToParent]);
|
||||
|
||||
// When the user switches site type, update the title default only if
|
||||
// the current title still matches the previous type's auto-fill value.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { NostrSigner, NPool } from '@nostrify/nostrify';
|
||||
import type { NostrSigner } from '@nostrify/nostrify';
|
||||
import mime from 'mime';
|
||||
import { nip19 } from 'nostr-tools';
|
||||
import type { JSRuntimeFS } from '../JSRuntime';
|
||||
|
||||
Reference in new issue
Block a user