u
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { notifyError } from '../utils/notify';
|
||||
import { bootstrapSession as bootstrapSessionThunk } from '../store/authSlice';
|
||||
|
||||
let sessionBootstrapped = false;
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@ import { connect } from 'react-redux';
|
||||
import Box from '@mui/material/Box';
|
||||
import Button from '@mui/material/Button';
|
||||
import GoogleIcon from '@mui/icons-material/Google';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { notifyErrorMessage } from '../utils/notify';
|
||||
import { loginWithGoogle, selectAuthStatus, selectGoogleClientId } from '../store/authSlice';
|
||||
import {
|
||||
abortGoogleSignIn,
|
||||
FEDCM_BLOCKED_MESSAGE,
|
||||
@@ -61,7 +63,7 @@ class LoginPage extends Component {
|
||||
const detail = [err?.message || String(err), err?.code, err?.status]
|
||||
.filter(Boolean)
|
||||
.join(' · ');
|
||||
enqueueSnackbar(`Login failed: ${detail}`, { variant: 'error' });
|
||||
notifyErrorMessage(`Login failed: ${detail}`);
|
||||
} finally {
|
||||
this.setState({ busy: false });
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { requireObject } from '../../utils/apiShape';
|
||||
import { notifyError } from '../../utils/notify';
|
||||
import { prepareArticlePhoto } from '../../utils/prepareArticlePhoto';
|
||||
import { pasteImageOrFallback } from '../../utils/pasteImage';
|
||||
import { primaryPhoto } from '../../utils/articleDetail';
|
||||
import { articleWithUploadedPhoto, primaryPhoto } from '../../utils/articleDetail';
|
||||
import ArticlePhoto from './ArticlePhoto';
|
||||
|
||||
export default function ArticlePhotoTile({
|
||||
@@ -28,8 +28,8 @@ export default function ArticlePhotoTile({
|
||||
const file = await prepareArticlePhoto(rawBlob);
|
||||
const res = await article.uploadImage(articleData.sku, file);
|
||||
requireObject(res, 'POST /api/article/:sku/image');
|
||||
requireObject(res.article, 'article');
|
||||
onArticleUpdated?.(res.article);
|
||||
requireObject(res.image, 'image');
|
||||
onArticleUpdated?.(articleWithUploadedPhoto(articleData, res.image));
|
||||
} catch (err) {
|
||||
notifyError(err);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user