feat(ext): shared toast notification system
This commit is contained in:
@@ -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');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user