mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-24 23:17:23 +00:00
request 64x64 icons for Taskbar via /whoami
This commit is contained in:
@@ -422,7 +422,7 @@ window.check_fsentry_against_allowed_file_types_string =function (fsentry, allow
|
||||
window.refresh_user_data = async (auth_token)=>{
|
||||
let whoami
|
||||
try{
|
||||
whoami = await puter.os.user();
|
||||
whoami = await puter.os.user({query: 'icon_size=64'});
|
||||
}catch(e){
|
||||
// Ignored
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ window.initgui = async function(options){
|
||||
puter.setAuthToken(query_param_auth_token);
|
||||
|
||||
try{
|
||||
whoami = await puter.os.user();
|
||||
whoami = await puter.os.user({query: 'icon_size=64'});
|
||||
}catch(e){
|
||||
if(e.status === 401){
|
||||
window.logout();
|
||||
@@ -456,7 +456,7 @@ window.initgui = async function(options){
|
||||
// try to get user data using /whoami, only if that data is missing
|
||||
if(!whoami){
|
||||
try{
|
||||
whoami = await puter.os.user();
|
||||
whoami = await puter.os.user({query: 'icon_size=64'});
|
||||
}catch(e){
|
||||
if(e.status === 401){
|
||||
bad_session_logout();
|
||||
|
||||
@@ -51,8 +51,13 @@ class OS{
|
||||
};
|
||||
}
|
||||
|
||||
let query = '';
|
||||
if(options?.query){
|
||||
query = '?' + new URLSearchParams(options.query).toString();
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const xhr = utils.initXhr('/whoami', this.APIOrigin, this.authToken, 'get');
|
||||
const xhr = utils.initXhr('/whoami' + query, this.APIOrigin, this.authToken, 'get');
|
||||
|
||||
// set up event handlers for load and error events
|
||||
utils.setupXhrEventHandlers(xhr, options.success, options.error, resolve, reject);
|
||||
|
||||
Reference in New Issue
Block a user