Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
set new url in gh config.yaml & set curl as default target for code
Browse files Browse the repository at this point in the history
  • Loading branch information
archywillhe committed Sep 30, 2023
1 parent 989edf6 commit 833e827
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Feature Request
url: https://github.com/Kong/insomnia/discussions/categories/ideas
url: https://github.com/ArchGPT/insomnium/discussions
about: Search and submit ideas for this project
- name: Question
url: https://chat.insomnia.rest/
about: Please ask and answer questions about Insomnium in our Slack Community
# - name: Question
# url: https://chat.insomnia.rest/
# about: Please ask and answer questions about Insomnium in our Slack Community
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import { ModalFooter } from '../base/modal-footer';
import { ModalHeader } from '../base/modal-header';
import { CodeEditor, CodeEditorHandle } from '../codemirror/code-editor';

const defaultTarget = '{"key":"shell","title":"Shell","extname":".sh","default":"curl","clients":[{"key":"curl","title":"cURL","link":"http://curl.haxx.se/","description":"cURL is a command line tool and library for transferring data with URL syntax"},{"key":"httpie","title":"HTTPie","link":"http://httpie.org/","description":"a CLI, cURL-like tool for humans"},{"key":"wget","title":"Wget","link":"https://www.gnu.org/software/wget/","description":"a free software package for retrieving files using HTTP, HTTPS"}]}'

const defaultClient = '{"key":"curl","title":"cURL","link":"http://curl.haxx.se/","description":"cURL is a command line tool and library for transferring data with URL syntax"}'

const MODE_MAP: Record<string, string> = {
c: 'clike',
java: 'clike',
Expand Down Expand Up @@ -48,11 +52,11 @@ export const GenerateCodeModal = forwardRef<GenerateCodeModalHandle, Props>((pro
let storedTarget: HTTPSnippetTarget | undefined;
let storedClient: HTTPSnippetClient | undefined;
try {
storedTarget = JSON.parse(window.localStorage.getItem('insomnia::generateCode::target') || '') as HTTPSnippetTarget;
storedTarget = JSON.parse(window.localStorage.getItem('insomnia::generateCode::target') || defaultTarget) as HTTPSnippetTarget;
} catch (error) {}

try {
storedClient = JSON.parse(window.localStorage.getItem('insomnia::generateCode::client') || '') as HTTPSnippetClient;
storedClient = JSON.parse(window.localStorage.getItem('insomnia::generateCode::client') || defaultClient) as HTTPSnippetClient;
} catch (error) {}
const [state, setState] = useState<State>({
cmd: '',
Expand Down

0 comments on commit 833e827

Please sign in to comment.