chore: Oauth temporary ux improvements (#3792)

This commit is contained in:
Akash K
2024-02-06 20:35:29 +05:30
committed by GitHub
parent 3911c9cd1f
commit 16803acb26
3 changed files with 73 additions and 45 deletions

View File

@@ -13,6 +13,7 @@ import { browserIsChrome, browserIsFirefox } from "~/helpers/utils/userAgent"
import SettingsExtension from "~/components/settings/Extension.vue"
import InterceptorsExtensionSubtitle from "~/components/interceptors/ExtensionSubtitle.vue"
import InterceptorsErrorPlaceholder from "~/components/interceptors/ErrorPlaceholder.vue"
import { until } from "@vueuse/core"
export const defineSubscribableObject = <T extends object>(obj: T) => {
const proxyObject = {
@@ -206,6 +207,14 @@ export class ExtensionInterceptorService
private async runRequestOnExtension(
req: AxiosRequestConfig
): RequestRunResult["response"] {
// wait for the extension to resolve
await until(this.extensionStatus).toMatch(
(status) => status !== "waiting",
{
timeout: 1000,
}
)
const extensionHook = window.__POSTWOMAN_EXTENSION_HOOK__
if (!extensionHook) {
return E.left(<InterceptorError>{