mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-28 05:52:49 +03:00
fixed avatar upload bug
This commit is contained in:
parent
c151559fd7
commit
816a32f8eb
@ -71,9 +71,20 @@ export default class SceneEditAccount extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
const json = await FileUtilities.upload({ file });
|
||||
const response = await FileUtilities.upload({ file });
|
||||
|
||||
if (json.error) {
|
||||
if (!response) {
|
||||
dispatchCustomEvent({
|
||||
name: "create-alert",
|
||||
detail: {
|
||||
alert: { message: "We're having trouble connecting right now" },
|
||||
},
|
||||
});
|
||||
this.setState({ changingAvatar: false });
|
||||
return;
|
||||
}
|
||||
|
||||
if (response.error) {
|
||||
dispatchCustomEvent({
|
||||
name: "create-alert",
|
||||
detail: { alert: { decorator: json.decorator } },
|
||||
@ -82,6 +93,8 @@ export default class SceneEditAccount extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
const { json } = response;
|
||||
|
||||
const cid = json.data.ipfs.replace("/ipfs/", "");
|
||||
const url = Strings.getCIDGatewayURL(cid);
|
||||
await Actions.updateViewer({
|
||||
|
Loading…
Reference in New Issue
Block a user