mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 03:56:23 +08:00
feat(core): duplicated calendar subscription notification (#12364)
This commit is contained in:
+12
-1
@@ -55,9 +55,20 @@ const AddSubscription = () => {
|
||||
}, []);
|
||||
|
||||
const handleAddSub = useCallback(() => {
|
||||
const _url = url.trim();
|
||||
const exists = calendar.getSubscription(_url);
|
||||
if (exists) {
|
||||
notify.error({
|
||||
title: t['com.affine.integration.calendar.new-duplicate-error-title'](),
|
||||
message:
|
||||
t['com.affine.integration.calendar.new-duplicate-error-content'](),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
setVerifying(true);
|
||||
calendar
|
||||
.createSubscription(url)
|
||||
.createSubscription(_url)
|
||||
.then(() => {
|
||||
setOpen(false);
|
||||
setUrl('');
|
||||
|
||||
Reference in New Issue
Block a user