Skip to content

Commit

Permalink
Merge pull request #288 from YujithIsura/master
Browse files Browse the repository at this point in the history
fixed party logo not showing issue in party edit
  • Loading branch information
YujithIsura authored Mar 12, 2020
2 parents 155b8e0 + af629a5 commit d808bbb
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions client/src/modules/party/state/PartyAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,23 @@ export function getPartyLogo(sid) {
}
)
.then(response => {
const partyLogo = window.URL.createObjectURL(new Blob([response.data]));
dispatch(partyLogoLoaded(partyLogo));
//**blob to dataURL**
const blob = new Blob([response.data]);
blobToDataURL(blob, (dataUrl) => {
dispatch(partyLogoLoaded(dataUrl));
});
// const partyLogo = window.URL.createObjectURL(new Blob([response.data]));
// dispatch(partyLogoLoaded(partyLogo));
}).catch(err => {
console.log(err)
});
};
}
}

//**blob to dataURL**
function blobToDataURL(blob, callback) {
var a = new FileReader();
a.onload = function(e) {callback(e.target.result);}
a.readAsDataURL(blob);
}

0 comments on commit d808bbb

Please sign in to comment.