()
| 142 | }) |
| 143 | |
| 144 | async function refreshSelectedSnippet() { |
| 145 | const snippetId = state.snippetId |
| 146 | const requestToken = ++selectedSnippetRequestToken |
| 147 | |
| 148 | if (snippetId === undefined) { |
| 149 | selectedSnippetRecord.value = undefined |
| 150 | return |
| 151 | } |
| 152 | |
| 153 | try { |
| 154 | const { data } = await api.snippets.getSnippetsById(String(snippetId)) |
| 155 | |
| 156 | if (requestToken === selectedSnippetRequestToken) { |
| 157 | selectedSnippetRecord.value = data |
| 158 | } |
| 159 | } |
| 160 | catch (error) { |
| 161 | if (requestToken === selectedSnippetRequestToken) { |
| 162 | selectedSnippetRecord.value = undefined |
| 163 | } |
| 164 | console.error(error) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | watch( |
| 169 | () => state.snippetId, |
no outgoing calls
no test coverage detected