mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +08:00
feat(core): copy to the clipboard whilst creating a shared link (#6555)
close TOV-797
This commit is contained in:
@@ -3,7 +3,6 @@ import {
|
||||
RadioButton,
|
||||
RadioButtonGroup,
|
||||
Switch,
|
||||
toast,
|
||||
} from '@affine/component';
|
||||
import { PublicLinkDisableModal } from '@affine/component/disable-public-link';
|
||||
import { Button } from '@affine/component/ui/button';
|
||||
@@ -86,13 +85,15 @@ export const AffineSharePage = (props: ShareMenuProps) => {
|
||||
|
||||
const onClickCreateLink = useCallback(() => {
|
||||
enableShare(mode);
|
||||
}, [enableShare, mode]);
|
||||
if (sharingUrl) {
|
||||
navigator.clipboard.writeText(sharingUrl).catch(err => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
}, [enableShare, mode, sharingUrl]);
|
||||
|
||||
const onDisablePublic = useCallback(() => {
|
||||
disableShare();
|
||||
toast('Successfully disabled', {
|
||||
portal: document.body,
|
||||
});
|
||||
setShowDisable(false);
|
||||
}, [disableShare]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user