Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Do not show site-specific autofill settings if globally disabled (#834)

Leendert de Borstdb825f415e42
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/Settings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/Settings.tsx
index 7d2a05317..cdf96cbd1 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/Settings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/Settings.tsx
@@ -222,45 +222,49 @@ const Settings: React.FC = () => {
</section>
{/* Site-Specific Settings Section */}
- <section>
- <h3 className="text-md font-semibold text-gray-900 dark:text-white mb-3">Site-Specific Settings</h3>
- <div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
- <div className="p-4">
- <div className="flex items-center justify-between">
- <div>
- <p className="text-sm font-medium text-gray-900 dark:text-white">Autofill popup on: {settings.currentUrl}</p>
- <p className={`text-sm mt-1 ${settings.isEnabled ? 'text-gray-600 dark:text-gray-400' : 'text-red-600 dark:text-red-400'}`}>
- {settings.isEnabled ? 'Enabled for this site' : 'Disabled for this site'}
- </p>
- {!settings.isEnabled && settings.temporaryDisabledUrls[settings.currentUrl] && (
- <p className="text-xs text-gray-500 dark:text-gray-400 mt-1">
- Temporarily disabled until {new Date(settings.temporaryDisabledUrls[settings.currentUrl]).toLocaleTimeString()}
+ {settings.isGloballyEnabled ? (
+ <section>
+ <h3 className="text-md font-semibold text-gray-900 dark:text-white mb-3">Site-Specific Settings</h3>
+ <div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
+ <div className="p-4">
+ <div className="flex items-center justify-between">
+ <div>
+ <p className="text-sm font-medium text-gray-900 dark:text-white">Autofill popup on: {settings.currentUrl}</p>
+ <p className={`text-sm mt-1 ${settings.isEnabled ? 'text-gray-600 dark:text-gray-400' : 'text-red-600 dark:text-red-400'}`}>
+ {settings.isEnabled ? 'Enabled for this site' : 'Disabled for this site'}
</p>
+ {!settings.isEnabled && settings.temporaryDisabledUrls[settings.currentUrl] && (
+ <p className="text-xs text-gray-500 dark:text-gray-400 mt-1">
+ Temporarily disabled until {new Date(settings.temporaryDisabledUrls[settings.currentUrl]).toLocaleTimeString()}
+ </p>
+ )}
+ </div>
+ {settings.isGloballyEnabled && (
+ <button
+ onClick={toggleCurrentSite}
+ className={`px-4 py-2 rounded-md transition-colors ${
+ settings.isEnabled
+ ? 'bg-green-500 hover:bg-green-600 text-white'
+ : 'bg-red-500 hover:bg-red-600 text-white'
+ }`}
+ >
+ {settings.isEnabled ? 'Enabled' : 'Disabled'}
+ </button>
)}
</div>
- <button
- onClick={toggleCurrentSite}
- className={`px-4 py-2 rounded-md transition-colors ${
- settings.isEnabled
- ? 'bg-green-500 hover:bg-green-600 text-white'
- : 'bg-red-500 hover:bg-red-600 text-white'
- }`}
- >
- {settings.isEnabled ? 'Enabled' : 'Disabled'}
- </button>
- </div>
- <div className="mt-4">
- <button
- onClick={resetSettings}
- className="w-full px-4 py-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 rounded-md text-gray-700 dark:text-gray-300 transition-colors text-sm"
- >
- Reset all site-specific settings
- </button>
+ <div className="mt-4">
+ <button
+ onClick={resetSettings}
+ className="w-full px-4 py-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 rounded-md text-gray-700 dark:text-gray-300 transition-colors text-sm"
+ >
+ Reset all site-specific settings
+ </button>
+ </div>
</div>
</div>
- </div>
- </section>
+ </section>
+ ) : (<></>)}
{/* Appearance Settings Section */}
<section>