mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 03:51:52 +08:00
Better loading detection
This commit is contained in:
@@ -108,17 +108,18 @@ export default class Moderation extends Component {
|
||||
const activeTab = this.props.route.path === ':id' ? 'premod' : this.props.route.path;
|
||||
const {asset} = root;
|
||||
|
||||
if (providedAssetId && !asset) {
|
||||
if (asset === undefined) {
|
||||
|
||||
// Still loading.
|
||||
return <Spinner />;
|
||||
}
|
||||
if (providedAssetId && asset === null) {
|
||||
|
||||
// Not found.
|
||||
return <NotFoundAsset assetId={providedAssetId} />;
|
||||
}
|
||||
|
||||
if (providedAssetId && (asset === undefined || asset.id !== providedAssetId)) {
|
||||
|
||||
// Still loading.
|
||||
return <Spinner />;
|
||||
}
|
||||
|
||||
const comments = root[activeTab];
|
||||
let activeTabCount;
|
||||
switch(activeTab) {
|
||||
|
||||
Reference in New Issue
Block a user