Web workers for the lsp servers (#2136)
* put the lsps into a web worker Signed-off-by: Jess Frazelle <github@jessfraz.com> * remove extraneous logs Signed-off-by: Jess Frazelle <github@jessfraz.com> * remove trash toml lib Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * less logs Signed-off-by: Jess Frazelle <github@jessfraz.com> * less logs Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes for tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * for playwright go back to the shitty lib Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -134,27 +134,14 @@ async function getUser(context: UserContext) {
|
||||
token: context.token,
|
||||
hostname: VITE_KC_API_BASE_URL,
|
||||
}).catch((err) => console.error('error from Tauri getUser', err))
|
||||
const tokenPromise = !isTauri()
|
||||
? fetch(withBaseURL('/user/api-tokens?limit=1'), {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
headers,
|
||||
})
|
||||
.then(async (res) => {
|
||||
const result: Models['ApiTokenResultsPage_type'] = await res.json()
|
||||
return result.items[0].token
|
||||
})
|
||||
.catch((err) => console.error('error from Browser getUser', err))
|
||||
: context.token
|
||||
|
||||
const user = await userPromise
|
||||
const token = await tokenPromise
|
||||
|
||||
if ('error_code' in user) throw new Error(user.message)
|
||||
|
||||
return {
|
||||
user,
|
||||
token,
|
||||
token: context.token,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user