File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,10 @@ export const onCreateSnippet = async (body: Partial<Snippet>) => {
4141 track ( 'api/snippet-create' )
4242}
4343
44- export const onAddNewFragment = ( ) => {
44+ export const onAddNewFragment = async ( ) => {
4545 const snippetStore = useSnippetStore ( )
4646
47- snippetStore . addNewFragmentToSnippetsById ( snippetStore . selectedId ! )
48- snippetStore . fragment = snippetStore . fragmentCount !
49-
47+ await snippetStore . addNewFragmentToSnippetsById ( snippetStore . selectedId ! )
5048 track ( 'snippets/add-fragment' )
5149}
5250
Original file line number Diff line number Diff line change @@ -195,8 +195,7 @@ export const useSnippetStore = defineStore('snippets', {
195195 body . content = content
196196
197197 await this . patchSnippetsById ( id , body )
198- await this . getSnippetsByFolderIds ( folderStore . selectedIds ! )
199- await this . getSnippetsById ( id )
198+ this . fragment = content . length - 1
200199 } ,
201200 async deleteCurrentSnippetFragmentByIndex ( index : number ) {
202201 const body : Partial < Snippet > = { }
You can’t perform that action at this time.
0 commit comments