feat(ext): shared toast notification system

This commit is contained in:
adlee-was-taken
2026-05-03 21:11:24 -04:00
parent ad6e4a2cd9
commit 1ec8965910
4 changed files with 106 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
/// to the detail view.
import { getState, setState, sendMessage, navigate, escapeHtml, openVaultTab } from '../../shared/state';
import { showToast } from '../../shared/toast';
import {
GLYPH_VAULT_TAB,
GLYPH_DEVICES, GLYPH_LOCK,
@@ -130,11 +131,14 @@ export function renderItemList(app: HTMLElement): void {
if (listResp.ok) {
const data = listResp.data as { items: Array<[ItemId, ManifestEntry]> };
setState({ entries: data.items, loading: false });
showToast('Synced', 'success');
return;
}
setState({ loading: false, error: listResp.error });
showToast(listResp.error ?? 'Sync failed', 'error');
} else {
setState({ loading: false, error: resp.error });
showToast(resp.error ?? 'Sync failed', 'error');
}
});