mirror of https://github.com/go-gitea/gitea.git
Change extName to use utils.js extname
This commit is contained in:
parent
b7828ad174
commit
64cffdd62e
|
@ -1,4 +1,5 @@
|
||||||
import {debounce} from 'throttle-debounce';
|
import {debounce} from 'throttle-debounce';
|
||||||
|
import {extname} from '../utils.js';
|
||||||
|
|
||||||
function elementsCall(el, func, ...args) {
|
function elementsCall(el, func, ...args) {
|
||||||
if (typeof el === 'string' || el instanceof String) {
|
if (typeof el === 'string' || el instanceof String) {
|
||||||
|
@ -271,8 +272,7 @@ export function getPastedContent(e) {
|
||||||
for (const item of data ?? []) {
|
for (const item of data ?? []) {
|
||||||
if (item?.kind === 'file') {
|
if (item?.kind === 'file') {
|
||||||
const file = item.getAsFile();
|
const file = item.getAsFile();
|
||||||
const extName = file.name.slice(file.name.lastIndexOf('.'), file.name.length);
|
if (acceptedFiles.includes(extname(file.name))) {
|
||||||
if (acceptedFiles.includes(extName)) {
|
|
||||||
files.push(file);
|
files.push(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue