Commit 3c03f222 authored by afc163's avatar afc163

Fix firefox error, close #677

parent c3dfe2eb
import React from 'react'; import React from 'react';
import PromiseRender from './PromiseRender'; import PromiseRender from './PromiseRender';
import { CURRENT } from './index'; import { CURRENT } from './index';
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}
/** /**
* ι€šη”¨ζƒι™ζ£€ζŸ₯方法 * ι€šη”¨ζƒι™ζ£€ζŸ₯方法
* Common check permissions method * Common check permissions method
...@@ -32,7 +37,7 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => { ...@@ -32,7 +37,7 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => {
} }
// Promise 倄理 // Promise 倄理
if (authority.constructor.name === 'Promise') { if (isPromise(authority)) {
return () => ( return () => (
<PromiseRender ok={target} error={Exception} promise={authority} /> <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