mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix(core): add loading status to share page button (#12288)
close AF-2615 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Enhancements** - Improved the share menu's user experience by showing a loading indicator and disabling the public page button during revalidation. This prevents user interaction while the share info is updating. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -21,6 +21,9 @@ export const PublicDoc = ({ disabled }: { disabled?: boolean }) => {
|
||||
const t = useI18n();
|
||||
const shareInfoService = useService(ShareInfoService);
|
||||
const isSharedPage = useLiveData(shareInfoService.shareInfo.isShared$);
|
||||
const isRevalidating = useLiveData(
|
||||
shareInfoService.shareInfo.isRevalidating$
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
shareInfoService.shareInfo.revalidate();
|
||||
@@ -135,6 +138,8 @@ export const PublicDoc = ({ disabled }: { disabled?: boolean }) => {
|
||||
contentStyle={{
|
||||
width: '100%',
|
||||
}}
|
||||
loading={isRevalidating}
|
||||
disabled={isRevalidating}
|
||||
>
|
||||
{isSharedPage
|
||||
? t['com.affine.share-menu.option.link.readonly']()
|
||||
|
||||
Reference in New Issue
Block a user