MCPcopy
hub / github.com/ganeshrvel/openmtp / processMtpOutput

Function processMtpOutput

app/containers/HomePage/actions.js:162–198  ·  view source on GitHub ↗
({
  deviceType,
  error,
  stderr,
  data, // eslint-disable-line no-unused-vars
  callback
})

Source from the content-addressed store, hash-verified

160}
161
162export function processMtpOutput({
163 deviceType,
164 error,
165 stderr,
166 data, // eslint-disable-line no-unused-vars
167 callback
168}) {
169 return async dispatch => {
170 try {
171 const {
172 status: mtpStatus,
173 error: mtpError,
174 throwAlert: mtpThrowAlert,
175 logError: mtpLogError
176 } = await processMtpBuffer({ error, stderr });
177
178 dispatch(setMtpStatus(mtpStatus));
179
180 if (!mtpStatus) {
181 dispatch(_fetchDirList([], deviceType));
182 dispatch(setSelectedDirLists({ selected: [] }, deviceType));
183 }
184
185 if (mtpError) {
186 log.error(mtpError, 'processMtpOutput', mtpLogError);
187 if (mtpThrowAlert) {
188 dispatch(throwAlert({ message: mtpError.toString() }));
189 }
190 return false;
191 }
192
193 callback();
194 } catch (e) {
195 log.error(e);
196 }
197 };
198}
199
200export function processLocalOutput({
201 deviceType, // eslint-disable-line no-unused-vars

Callers 6

mapDispatchToPropsFunction · 0.90
mapDispatchToPropsFunction · 0.90
pasteFilesFunction · 0.90
_pasteFilesFunction · 0.90
setMtpStorageOptionsFunction · 0.85
fetchDirListFunction · 0.85

Calls 5

processMtpBufferFunction · 0.90
throwAlertFunction · 0.90
setMtpStatusFunction · 0.85
_fetchDirListFunction · 0.85
setSelectedDirListsFunction · 0.85

Tested by

no test coverage detected