We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f819f4a commit 4c52a5eCopy full SHA for 4c52a5e
src/renderer/composables/useSnippets.ts
@@ -182,12 +182,15 @@ async function duplicateSnippet(snippetId: number) {
182
183
async function createSnippetContent(snippetId: number) {
184
const lastContentIndex = selectedSnippet.value?.contents.length || 0
185
+ const folder = folders.value?.find(
186
+ f => f.id === selectedSnippet.value?.folder?.id,
187
+ )
188
189
try {
190
await api.snippets.postSnippetsByIdContents(String(snippetId), {
191
label: `${i18n.t('fragment')} ${lastContentIndex + 1}`,
192
value: '',
- language: 'plain_text',
193
+ language: folder?.defaultLanguage || 'plain_text',
194
})
195
196
await getSnippets(queryByLibraryOrFolderOrSearch.value)
0 commit comments