Skip to content

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

Update storage insights confirm dialog logic (#2413)

Leendert de Borst9d58c247bc7a
diff --git a/apps/server/AliasVault.Client/Resources/Pages/Main/Settings/StorageInsights.en.resx b/apps/server/AliasVault.Client/Resources/Pages/Main/Settings/StorageInsights.en.resx
index 16f5c24c6..6f8e1d31b 100644
--- a/apps/server/AliasVault.Client/Resources/Pages/Main/Settings/StorageInsights.en.resx
+++ b/apps/server/AliasVault.Client/Resources/Pages/Main/Settings/StorageInsights.en.resx
@@ -167,4 +167,12 @@
<value>This re-fetches the favicon for every credential that has a website URL, replacing the existing logo. Depending on your vault size this may take a while. Continue?</value>
<comment>Confirmation modal body for redownload-all-logos</comment>
</data>
+ <data name="DeleteAllLogosSuccessMessage">
+ <value>Removed the logo of {0} items.</value>
+ <comment>Success message after deleting all logos, {0} is the number of items</comment>
+ </data>
+ <data name="RedownloadAllLogosSuccessMessage">
+ <value>Updated the logo of {0} items.</value>
+ <comment>Success message after re-downloading all logos, {0} is the number of items</comment>
+ </data>
</root>
diff --git a/apps/web/src/components/alerts/GlobalNotificationDisplay.tsx b/apps/web/src/components/alerts/GlobalNotificationDisplay.tsx
index badfbd883..2e59ba945 100644
--- a/apps/web/src/components/alerts/GlobalNotificationDisplay.tsx
+++ b/apps/web/src/components/alerts/GlobalNotificationDisplay.tsx
@@ -21,7 +21,12 @@ const GlobalNotificationDisplay: React.FC<GlobalNotificationDisplayProps> = ({ m
const [messages, setMessages] = useState<Notification[]>([]);
useEffect(() => {
- setMessages(takeMessages());
+ const taken = takeMessages();
+ setMessages(taken);
+ if (taken.length > 0) {
+ // Messages render at the top of the page, so bring them into view when the user has scrolled down.
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ }
}, [takeMessages, version, location.pathname]);
if (messages.length === 0) {
diff --git a/apps/web/src/pages/settings/StorageInsights.tsx b/apps/web/src/pages/settings/StorageInsights.tsx
index be099b78b..003902ac9 100644
--- a/apps/web/src/pages/settings/StorageInsights.tsx
+++ b/apps/web/src/pages/settings/StorageInsights.tsx
@@ -211,10 +211,11 @@ const StorageInsights: React.FC = () => {
}
setIsDeletingLogos(true);
try {
+ let removed = 0;
await executeVaultMutationAsync(async () => {
- await client.logos.deleteAllFavicons();
+ removed = await client.logos.deleteAllFavicons();
});
- notifications.addSuccessMessage(t('sharedResources.Success'));
+ notifications.addSuccessMessage(t(`${tk}.DeleteAllLogosSuccessMessage`, { 0: removed }), true);
} catch (error) {
console.error('Failed to delete the logos:', error);
notifications.addErrorMessage(t('sharedResources.ErrorGeneric'), true);
@@ -239,14 +240,16 @@ const StorageInsights: React.FC = () => {
setRedownloadProgress({ processed: 0, total: 0 });
try {
let rateLimited = false;
+ let changed = 0;
await executeVaultMutationAsync(async () => {
const result = await BulkFaviconService.refreshVaultFavicons(client, webApi, (processed, total) => setRedownloadProgress({ processed, total }));
rateLimited = result.status === 'rateLimited';
+ changed = result.changedItems;
});
if (rateLimited) {
notifications.addErrorMessage(t('sharedResources.ErrorGeneric'), true);
} else {
- notifications.addSuccessMessage(t('sharedResources.Success'));
+ notifications.addSuccessMessage(t(`${tk}.RedownloadAllLogosSuccessMessage`, { 0: changed }), true);
}
} catch (error) {
console.error('Failed to re-download the logos:', error);