-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Description
hi team, seems like the getDeveloperProfile method isn't doing anything, as it's not resolving or rejecting the promise
furthermore, we have duplicated code for how we handle the options
puter/src/puter-js/src/modules/Apps.js
Lines 197 to 235 in 9d307d5
| getDeveloperProfile = function (...args) { | |
| let options; | |
| // If first argument is an object, it's the options | |
| if ( typeof args[0] === 'object' && args[0] !== null ) { | |
| options = args[0]; | |
| } else { | |
| // Otherwise, we assume separate arguments are provided | |
| options = { | |
| success: args[0], | |
| error: args[1], | |
| }; | |
| } | |
| return new Promise((resolve, reject) => { | |
| let options; | |
| // If first argument is an object, it's the options | |
| if ( typeof args[0] === 'object' && args[0] !== null ) { | |
| options = args[0]; | |
| } else { | |
| // Otherwise, we assume separate arguments are provided | |
| options = { | |
| success: args[0], | |
| error: args[1], | |
| }; | |
| } | |
| return new Promise((resolve, reject) => { | |
| const xhr = utils.initXhr('/get-dev-profile', puter.APIOrigin, puter.authToken, 'get'); | |
| // set up event handlers for load and error events | |
| utils.setupXhrEventHandlers(xhr, options.success, options.error, resolve, reject); | |
| xhr.send(); | |
| }); | |
| }); | |
| }; | |
| } |
we have promise double wrapped, and i think the outer promise don't get resolved
Metadata
Metadata
Assignees
Labels
No labels