Move toasts to sonner (#6053)

This commit is contained in:
Tom Moor
2023-10-22 17:30:24 -04:00
committed by GitHub
parent 389297a337
commit ef76405bd6
92 changed files with 363 additions and 1015 deletions

View File

@@ -1,5 +1,6 @@
import { Node } from "prosemirror-model";
import { EditorView } from "prosemirror-view";
import { toast } from "sonner";
function findPlaceholderLink(doc: Node, href: string) {
let result: { pos: number; node: Node } | undefined;
@@ -38,11 +39,10 @@ const createAndInsertLink = async function (
options: {
dictionary: any;
onCreateLink: (title: string) => Promise<string>;
onShowToast: (message: string) => void;
}
) {
const { dispatch, state } = view;
const { onCreateLink, onShowToast } = options;
const { onCreateLink } = options;
try {
const url = await onCreateLink(title);
@@ -79,7 +79,7 @@ const createAndInsertLink = async function (
)
);
onShowToast(options.dictionary.createLinkError);
toast.error(options.dictionary.createLinkError);
}
};