Skip to content

puter.auth.getDeveloperProfile() doesn't do anything #2196

@reynaldichernando

Description

@reynaldichernando

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

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions