|
|
@@ -31,9 +31,9 @@ const CustomSidebar: FC<Props> = (props: Props) => {
|
|
|
|
|
|
const renderer = appContainer.getRenderer('sidebar');
|
|
|
|
|
|
- const { data: page, mutate } = useSWRxPageByPath('/Sidebar');
|
|
|
+ const { data: page, error, mutate } = useSWRxPageByPath('/Sidebar');
|
|
|
|
|
|
- const isLoading = page === undefined;
|
|
|
+ const isLoading = page === undefined && error == null;
|
|
|
const markdown = (page?.revision as IRevision | undefined)?.body;
|
|
|
|
|
|
return (
|
|
|
@@ -47,20 +47,31 @@ const CustomSidebar: FC<Props> = (props: Props) => {
|
|
|
<i className="icon icon-reload"></i>
|
|
|
</button>
|
|
|
</div>
|
|
|
- { !isLoading && markdown == null && <SidebarNotFound /> }
|
|
|
- {/* eslint-disable-next-line react/no-danger */}
|
|
|
- { markdown != null && (
|
|
|
- <div className="p-3">
|
|
|
- <RevisionRenderer
|
|
|
- growiRenderer={renderer}
|
|
|
- markdown={markdown}
|
|
|
- additionalClassName="grw-custom-sidebar-content"
|
|
|
- />
|
|
|
- </div>
|
|
|
- ) }
|
|
|
+
|
|
|
+ {
|
|
|
+ isLoading && (
|
|
|
+ <div className="text-muted text-center">
|
|
|
+ <i className="fa fa-2x fa-spinner fa-pulse mr-1"></i>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ {
|
|
|
+ !isLoading && markdown != null ? (
|
|
|
+ <div className="p-3">
|
|
|
+ <RevisionRenderer
|
|
|
+ growiRenderer={renderer}
|
|
|
+ markdown={markdown}
|
|
|
+ additionalClassName="grw-custom-sidebar-content"
|
|
|
+ isRenderable
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ <SidebarNotFound />
|
|
|
+ )
|
|
|
+ }
|
|
|
</>
|
|
|
);
|
|
|
-
|
|
|
};
|
|
|
|
|
|
/**
|