Browse Source

💄 fix eslint error

pull/18516/head
afc163 5 years ago
parent
commit
67cebf6da6
  1. 2
      .eslintrc.js
  2. 2
      site/theme/template/IconDisplay/IconPicSearcher.tsx

2
.eslintrc.js

@ -16,7 +16,7 @@ const eslintrc = {
},
settings: {
react: {
version: '16.8',
version: '16.9',
},
},
parser: '@typescript-eslint/parser',

2
site/theme/template/IconDisplay/IconPicSearcher.tsx

@ -72,7 +72,7 @@ class PicSearcher extends Component<PicSearcherProps, PicSearcherState> {
const img = new Image();
img.setAttribute('crossOrigin', 'anonymous');
img.src = url;
img.onload = function() {
img.onload = function onload() {
const scale = Math.min(1, 300 / Math.max(img.width, img.height));
const canvas = document.createElement('canvas');
canvas.width = img.width * scale;

Loading…
Cancel
Save