fix: make getEmbedLink independent of t function (#7643)

* fix: make getEmbedLink independent of t function

* rename warning to error and make it type safe
This commit is contained in:
Aakansha Doshi 2024-02-01 21:12:10 +05:30 committed by GitHub
parent 0e0f34edd8
commit 0c3dffb082
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 9 deletions

View file

@ -6501,8 +6501,11 @@ class App extends React.Component<AppProps, AppState> {
return;
}
if (embedLink.warning) {
this.setToast({ message: embedLink.warning, closable: true });
if (embedLink.error instanceof URIError) {
this.setToast({
message: t("toast.unrecognizedLinkFormat"),
closable: true,
});
}
const element = newEmbeddableElement({