From 49daa2937f07bcb5bface5e8cb1cb88184f87c71 Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Mon, 1 Jan 2024 15:42:50 +0800 Subject: [PATCH] fix: $:/info/tidgi/enableHTTPAPI not found --- src/services/wiki/plugin/ipcSyncAdaptor/fix-location-info.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/wiki/plugin/ipcSyncAdaptor/fix-location-info.ts b/src/services/wiki/plugin/ipcSyncAdaptor/fix-location-info.ts index 2c7f4558..7835d28f 100644 --- a/src/services/wiki/plugin/ipcSyncAdaptor/fix-location-info.ts +++ b/src/services/wiki/plugin/ipcSyncAdaptor/fix-location-info.ts @@ -17,6 +17,9 @@ function getInfoTiddlerFields(updateInfoTiddlersCallback: (infos: Array<{ text: infoTiddlerFields.push({ title: '$:/info/tidgi', text: mapBoolean(isInTidGi) }); if (isInTidGi && workspaceID) { infoTiddlerFields.push({ title: '$:/info/tidgi/workspaceID', text: workspaceID }); + /** + * Push to asyncInfoTiddlerFields in this async function + */ void window.service.workspace.get(workspaceID).then(async (workspace) => { if (workspace === undefined) return; const { @@ -42,7 +45,7 @@ function getInfoTiddlerFields(updateInfoTiddlersCallback: (infos: Array<{ text: setLocationProperty('search', urlObject.search); setLocationProperty('origin', urlObject.origin); - infoTiddlerFields.push({ title: '$:/info/tidgi/tokenAuth', text: mapBoolean(tokenAuth) }, { title: '$:/info/tidgi/enableHTTPAPI', text: mapBoolean(enableHTTPAPI) }); + asyncInfoTiddlerFields.push({ title: '$:/info/tidgi/tokenAuth', text: mapBoolean(tokenAuth) }, { title: '$:/info/tidgi/enableHTTPAPI', text: mapBoolean(enableHTTPAPI) }); if (tokenAuth) { const fallbackUserName = await window.service.auth.get('userName'); const tokenAuthHeader = `"${getTidGiAuthHeaderWithToken(authToken ?? '')}": "${userName || fallbackUserName || ''}"`;