mirror of
https://github.com/HeyPuter/puter.git
synced 2025-12-30 17:50:00 -06:00
fix: timing for PrefixLogger call to /whoami
This commit fixes the timing of the /whoami call used for the PrefixLogger (a logger for puter.js that displays app names) to ensure the API origin and token are available. This is done by waiting for a service called 'api-access' to be initialized first. This was discovered while testing changes for /whoami responses that display icons, because the current behavior breaks the call for non-puter.com instances.
This commit is contained in:
@@ -288,6 +288,7 @@ window.puter = (function() {
|
||||
|
||||
// Add prefix logger (needed to happen after modules are initialized)
|
||||
(async () => {
|
||||
await this.services.wait_for_init(['api-access']);
|
||||
const whoami = await this.auth.whoami();
|
||||
logger = new putility.libs.log.PrefixLogger({
|
||||
delegate: logger,
|
||||
|
||||
Reference in New Issue
Block a user