mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 02:20:19 +08: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:
+5
@@ -21,6 +21,9 @@ export const PublicDoc = ({ disabled }: { disabled?: boolean }) => {
|
|||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const shareInfoService = useService(ShareInfoService);
|
const shareInfoService = useService(ShareInfoService);
|
||||||
const isSharedPage = useLiveData(shareInfoService.shareInfo.isShared$);
|
const isSharedPage = useLiveData(shareInfoService.shareInfo.isShared$);
|
||||||
|
const isRevalidating = useLiveData(
|
||||||
|
shareInfoService.shareInfo.isRevalidating$
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
shareInfoService.shareInfo.revalidate();
|
shareInfoService.shareInfo.revalidate();
|
||||||
@@ -135,6 +138,8 @@ export const PublicDoc = ({ disabled }: { disabled?: boolean }) => {
|
|||||||
contentStyle={{
|
contentStyle={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}}
|
}}
|
||||||
|
loading={isRevalidating}
|
||||||
|
disabled={isRevalidating}
|
||||||
>
|
>
|
||||||
{isSharedPage
|
{isSharedPage
|
||||||
? t['com.affine.share-menu.option.link.readonly']()
|
? t['com.affine.share-menu.option.link.readonly']()
|
||||||
|
|||||||
Reference in New Issue
Block a user