mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 18:01:08 +01:00
Filesystem Sync (#142)
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import type {AnyModel, GrpcRequest, HttpRequest} from '@yaakapp-internal/models';
|
||||
import type { AnyModel, GrpcRequest, HttpRequest } from '@yaakapp-internal/models';
|
||||
|
||||
export function fallbackRequestName(r: HttpRequest | GrpcRequest | AnyModel | null): string {
|
||||
if (r == null) return '';
|
||||
|
||||
if (r.model !== 'grpc_request' && r.model !== 'http_request') {
|
||||
return 'name' in r ? r.name : '';
|
||||
}
|
||||
|
||||
// Return name if it has one
|
||||
if ('name' in r && r.name) {
|
||||
return r.name;
|
||||
}
|
||||
|
||||
if (r.model !== 'http_request' && r.model !== 'grpc_request') {
|
||||
return 'No Name';
|
||||
}
|
||||
|
||||
// Replace variable syntax with variable name
|
||||
const withoutVariables = r.url.replace(/\$\{\[\s*([^\]\s]+)\s*]}/g, '$1');
|
||||
if (withoutVariables.trim() === '') {
|
||||
|
||||
@@ -7,10 +7,8 @@ type TauriCmd =
|
||||
| 'cmd_create_cookie_jar'
|
||||
| 'cmd_create_environment'
|
||||
| 'cmd_template_tokens_to_string'
|
||||
| 'cmd_create_folder'
|
||||
| 'cmd_create_grpc_request'
|
||||
| 'cmd_create_http_request'
|
||||
| 'cmd_create_workspace'
|
||||
| 'cmd_curl_to_request'
|
||||
| 'cmd_delete_all_grpc_connections'
|
||||
| 'cmd_delete_all_http_responses'
|
||||
|
||||
Reference in New Issue
Block a user