mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 15:29:40 +01:00
OAuth flows can be cancelled; discovery no longer waits for a pending login
- Only login, logout, refresh and revoke queue behind each other; discovery, test, userinfo and introspection run at once - Cancel in the OAuth panel (and Cancel on the request) stops the flow, frees the callback port and the login lock - Undefined variables in issuer, endpoints or client id are reported before any request is sent - Keyring commands run off the UI thread, so a KWallet prompt cannot freeze the window - One click on a collection opens its settings; the chevron folds it - Until an environment is picked, local (or the first one) is active; the environment editor says when the shown one is not active
This commit is contained in:
@@ -70,12 +70,19 @@ class Workspace {
|
||||
return this.collections.find((c) => c.id === id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Active environment. Until one is picked, `local` (or the first one) is
|
||||
* active, so variables resolve right away. Picking "No environment" is
|
||||
* remembered as an explicit null.
|
||||
*/
|
||||
env(col: string | null): string | null {
|
||||
if (!col) return null;
|
||||
const c = this.collection(col);
|
||||
const chosen = this.envByCol[col];
|
||||
if (chosen === null) return null;
|
||||
if (chosen && c?.environments.some((e) => e.id === chosen)) return chosen;
|
||||
return null;
|
||||
const envs = c?.environments ?? [];
|
||||
return (envs.find((e) => e.id === 'local') ?? envs[0])?.id ?? null;
|
||||
}
|
||||
|
||||
setEnv(col: string, env: string | null) {
|
||||
|
||||
Reference in New Issue
Block a user