mirror of
https://github.com/mountain-loop/yaak.git
synced 2025-12-05 19:17:44 -06:00
Compare commits
2 Commits
6e4c167bfd
...
095af8cf4b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
095af8cf4b | ||
|
|
e1c1ecc34d |
@@ -5,9 +5,9 @@
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"build": "run-p build:*",
|
||||
"build": "run-s build:*",
|
||||
"build:1-build": "yaakcli build",
|
||||
"build:2-cpywasm": "cpx '../../node_modules/@1password/sdk-core/nodejs/core_bg.*' build/",
|
||||
"build:2-cpywasm": "cp \"../../node_modules/@1password/sdk-core/nodejs/core_bg.wasm\" build/",
|
||||
"dev": "yaakcli dev"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"endpoints": [
|
||||
"https://update.yaak.app/check/{{target}}/{{arch}}/{{current_version}}"
|
||||
],
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEMxRDJFREQ1MjExQjdGN0IKUldSN2Z4c2gxZTNTd1FHNCtmYnFXMHVVQzhuNkJOM1cwOFBodmdLall3ckhKenpKUytHSTR1MlkK"
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEVGRkFGMjQxRUNEOTQ3MzAKUldRd1I5bnNRZkw2NzRtMnRlWTN3R24xYUR3aGRsUjJzWGwvdHdEcGljb3ZJMUNlMjFsaHlqVU4K"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import type {
|
||||
Folder,
|
||||
GrpcRequest,
|
||||
HttpRequest,
|
||||
WebsocketRequest,
|
||||
Workspace,
|
||||
import {
|
||||
environmentsAtom,
|
||||
type Folder,
|
||||
type GrpcRequest,
|
||||
type HttpRequest,
|
||||
httpResponsesAtom,
|
||||
pluginsAtom,
|
||||
type WebsocketRequest,
|
||||
type Workspace,
|
||||
} from '@yaakapp-internal/models';
|
||||
import { environmentsAtom, httpResponsesAtom } from '@yaakapp-internal/models';
|
||||
import type { GetTemplateFunctionConfigResponse, JsonPrimitive } from '@yaakapp-internal/plugins';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { md5 } from 'js-md5';
|
||||
@@ -19,6 +21,7 @@ export function useTemplateFunctionConfig(
|
||||
values: Record<string, JsonPrimitive>,
|
||||
model: HttpRequest | GrpcRequest | WebsocketRequest | Folder | Workspace,
|
||||
) {
|
||||
const pluginsKey = useAtomValue(pluginsAtom);
|
||||
const workspaceId = useAtomValue(activeWorkspaceIdAtom);
|
||||
const environmentId = useAtomValue(activeEnvironmentIdAtom);
|
||||
const responses = useAtomValue(httpResponsesAtom);
|
||||
@@ -40,10 +43,11 @@ export function useTemplateFunctionConfig(
|
||||
model,
|
||||
functionName,
|
||||
values,
|
||||
responseKey,
|
||||
workspaceId,
|
||||
environmentId,
|
||||
environmentsKey,
|
||||
workspaceId, // Refresh when the active workspace changes
|
||||
environmentId, // Refresh when the active environment changes
|
||||
environmentsKey, // Refresh when environments change
|
||||
responseKey, // Refresh when responses change
|
||||
pluginsKey, // Refresh when plugins reload
|
||||
],
|
||||
placeholderData: (prev) => prev, // Keep previous data on refetch
|
||||
queryFn: async () => {
|
||||
|
||||
Reference in New Issue
Block a user