mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
DEV: Use Ember getter and explicitly check for undefined (#16618)
Context -> https://deprecations.emberjs.com/v3.x/#toc_ember-metal-get-with-default
This commit is contained in:
parent
db9ae32e41
commit
71a4e9db85
|
@ -546,10 +546,12 @@ export default Component.extend(TextareaTextManipulation, {
|
||||||
|
|
||||||
// note this will only work for emojis starting with :
|
// note this will only work for emojis starting with :
|
||||||
// eg: :-)
|
// eg: :-)
|
||||||
|
const emojiTranslation =
|
||||||
|
this.get("site.custom_emoji_translation") || {};
|
||||||
const allTranslations = Object.assign(
|
const allTranslations = Object.assign(
|
||||||
{},
|
{},
|
||||||
translations,
|
translations,
|
||||||
this.getWithDefault("site.custom_emoji_translation", {})
|
emojiTranslation
|
||||||
);
|
);
|
||||||
if (allTranslations[full]) {
|
if (allTranslations[full]) {
|
||||||
return resolve([allTranslations[full]]);
|
return resolve([allTranslations[full]]);
|
||||||
|
|
|
@ -120,10 +120,8 @@ export default Mixin.create(UppyS3Multipart, ExtendableUploader, {
|
||||||
onBeforeUpload: (files) => {
|
onBeforeUpload: (files) => {
|
||||||
let tooMany = false;
|
let tooMany = false;
|
||||||
const fileCount = Object.keys(files).length;
|
const fileCount = Object.keys(files).length;
|
||||||
const maxFiles = this.getWithDefault(
|
const maxFiles =
|
||||||
"maxFiles",
|
this.maxFiles || this.siteSettings.simultaneous_uploads;
|
||||||
this.siteSettings.simultaneous_uploads
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this.allowMultipleFiles) {
|
if (this.allowMultipleFiles) {
|
||||||
tooMany = maxFiles > 0 && fileCount > maxFiles;
|
tooMany = maxFiles > 0 && fileCount > maxFiles;
|
||||||
|
@ -396,11 +394,8 @@ export default Mixin.create(UppyS3Multipart, ExtendableUploader, {
|
||||||
},
|
},
|
||||||
|
|
||||||
_xhrUploadUrl() {
|
_xhrUploadUrl() {
|
||||||
return (
|
const uploadUrl = this.uploadUrl || this.uploadRootPath;
|
||||||
getUrl(this.getWithDefault("uploadUrl", this.uploadRootPath)) +
|
return getUrl(uploadUrl) + ".json?client_id=" + this.messageBus?.clientId;
|
||||||
".json?client_id=" +
|
|
||||||
this.messageBus?.clientId
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_bindFileInputChange() {
|
_bindFileInputChange() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user