mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 06:00:21 +08: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:
parent
cb2653b84d
commit
2dc6c4737b
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user