Skip to content

Commit

Permalink
- fixed report issue without screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskovar-m2ms committed Feb 3, 2021
1 parent 1031ec9 commit b32e3d5
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions js/components/userFeedback/githubApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,20 @@ export const createIssue = ({
dispatch(setResponse(''));
const rootReducer = getState();

// const state => state.issueReducers;
const screenshotUrl = await dispatch(
uploadFile({
data64Based: imageSource.split(',')[1],
formType,
name: 'Screenshot',
extension: EXTENSION.PNG,
raw: true
})
);
let screenshotUrl = undefined;
if (imageSource && imageSource !== '') {
// const state => state.issueReducers;
screenshotUrl = await dispatch(
uploadFile({
data64Based: imageSource.split(',')[1],
formType,
name: 'Screenshot',
extension: EXTENSION.PNG,
raw: true
})
);
}

const reducerUrl = await dispatch(
uploadFile({
data64Based: Base64.encode(JSON.stringify(rootReducer)),
Expand All @@ -96,7 +100,7 @@ export const createIssue = ({
body.push('- Reducers: ' + reducerUrl);
}

if (screenshotUrl.length > 0) {
if (screenshotUrl && screenshotUrl.length > 0) {
body.push('', '![screenshot](' + screenshotUrl + ')');
}

Expand Down

0 comments on commit b32e3d5

Please sign in to comment.