Commit 3c03f222 authored by afc163's avatar afc163

Fix firefox error, close #677

parent c3dfe2eb
import React from 'react';
import PromiseRender from './PromiseRender';
import { CURRENT } from './index';
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}
/**
* ι€šη”¨ζƒι™ζ£€ζŸ₯方法
* Common check permissions method
......@@ -32,7 +37,7 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => {
}
// Promise 倄理
if (authority.constructor.name === 'Promise') {
if (isPromise(authority)) {
return () => (
<PromiseRender ok={target} error={Exception} promise={authority} />
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment