File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export const useSubmitSnippet = (): UseSubmitSnippet => {
8686 const submitSnippet = useCallback ( async ( action : SubmitSnippetAction = SubmitSnippetAction . SAVE ) => {
8787 setCurrentNotice ( undefined )
8888
89- const rawResult = await ( async ( ) : Promise < Snippet | string | undefined > => {
89+ const result = await ( async ( ) : Promise < Snippet | string | undefined > => {
9090 try {
9191 const request : Snippet = { ...snippet , ...SUBMIT_ACTION_DELTA [ action ] }
9292 const response = await ( 0 === request . id ? snippetsAPI . create ( request ) : snippetsAPI . update ( request ) )
@@ -100,17 +100,17 @@ export const useSubmitSnippet = (): UseSubmitSnippet => {
100100
101101 const messages = isCondition ( snippet ) ? conditionMessages : snippetMessages
102102
103- if ( undefined === rawResult || 'string' === typeof rawResult ) {
103+ if ( undefined === result || 'string' === typeof result ) {
104104 const message = [
105105 snippet . id ? messages . failedUpdate : messages . failedCreate ,
106- rawResult ?? __ ( 'The server did not send a valid response.' , 'code-snippets' )
106+ result ?? __ ( 'The server did not send a valid response.' , 'code-snippets' )
107107 ]
108108
109109 setCurrentNotice ( [ 'error' , message . filter ( Boolean ) . join ( ' ' ) ] )
110110 return undefined
111111 }
112112
113- const updatedSnippet = createSnippetObject ( rawResult )
113+ const updatedSnippet = createSnippetObject ( result )
114114 setSnippet ( updatedSnippet )
115115
116116 if ( updatedSnippet . code_error ) {
You can’t perform that action at this time.
0 commit comments