diff --git a/frontend/public/locales/en-GB/translation.toml b/frontend/public/locales/en-GB/translation.toml index 6e9f217ab..2fa1710b9 100644 --- a/frontend/public/locales/en-GB/translation.toml +++ b/frontend/public/locales/en-GB/translation.toml @@ -6564,6 +6564,7 @@ link = "or connect to a self-hosted account" title = "Connect to Server" subtitle = "Enter your self-hosted server URL" testing = "Testing connection..." +useLast = "Last used server: {{serverUrl}}" [setup.server.type] saas = "Stirling PDF SaaS" diff --git a/frontend/src/desktop/components/SetupWizard/ServerSelection.tsx b/frontend/src/desktop/components/SetupWizard/ServerSelection.tsx index 091c01d1e..497875091 100644 --- a/frontend/src/desktop/components/SetupWizard/ServerSelection.tsx +++ b/frontend/src/desktop/components/SetupWizard/ServerSelection.tsx @@ -16,12 +16,13 @@ export const ServerSelection: React.FC = ({ onSelect, load const [testing, setTesting] = useState(false); const [testError, setTestError] = useState(null); const [securityDisabled, setSecurityDisabled] = useState(false); + const serverUrl = localStorage.getItem('server_url') || ''; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); // Normalize and validate URL - let url = customUrl.trim().replace(/\/+$/, ''); + let url = customUrl.trim().replace(/\/+$/, '') || serverUrl; if (!url) { setTestError(t('setup.server.error.emptyUrl', 'Please enter a server URL')); @@ -34,6 +35,7 @@ export const ServerSelection: React.FC = ({ onSelect, load url = `https://${url}`; setCustomUrl(url); // Update the input field } + localStorage.setItem('server_url', url); // Validate URL format try { @@ -207,6 +209,21 @@ export const ServerSelection: React.FC = ({ onSelect, load )} + {serverUrl && ( +
+ +
+ )} +