mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
fix(ssr): fix window references
This commit is contained in:
@@ -20,7 +20,7 @@ export function get(element: Element | Window, path: string) {
|
||||
*/
|
||||
export function getPromise(callback: Function = () => {}): Promise<any> {
|
||||
const tryNativePromise = () => {
|
||||
if (window.Promise) {
|
||||
if (typeof Promise === 'function' || (typeof window !== 'undefined' && window.Promise)) {
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
callback(resolve, reject);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user