try-catch potentially fallible mutiny_wallet calls

This commit is contained in:
Paul Miller
2023-06-20 13:54:52 -05:00
parent 5a7e67ea05
commit 6c4939603c
10 changed files with 139 additions and 87 deletions

View File

@@ -208,7 +208,12 @@ export const Provider: ParentComponent = (props) => {
setState({ dismissed_restore_prompt: true });
},
async listTags(): Promise<MutinyTagItem[]> {
return state.mutiny_wallet?.get_tag_items() as MutinyTagItem[];
try {
return state.mutiny_wallet?.get_tag_items() as MutinyTagItem[];
} catch (e) {
console.error(e);
return [];
}
},
setNwc(enabled: boolean) {
localStorage.setItem("nwc_enabled", enabled.toString());