Use const instead of let when possible
This commit is contained in:
@@ -27,7 +27,7 @@ Rectangle {
|
||||
|
||||
function enterClickButton() {
|
||||
for (let i = 0; i < buttonModel.length; i++) {
|
||||
let btn = buttonRepeater.itemAt(i)
|
||||
const btn = buttonRepeater.itemAt(i)
|
||||
if (btn.enabled && btn.name === clickButtonOnEnter) btn.clicked()
|
||||
}
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ Menu {
|
||||
let result = 0
|
||||
|
||||
for (let i = 0; i < count; ++i) {
|
||||
let item = itemAt(i)
|
||||
const item = itemAt(i)
|
||||
if (! item.visible) continue
|
||||
|
||||
result = Math.max(item.implicitWidth, result)
|
||||
|
@@ -25,8 +25,8 @@ HImage {
|
||||
function update() {
|
||||
if (! py) return // component was destroyed
|
||||
|
||||
let w = sourceSize.width || width
|
||||
let h = sourceSize.height || height
|
||||
const w = sourceSize.width || width
|
||||
const h = sourceSize.height || height
|
||||
|
||||
if (! image.mxc || w < 1 || h < 1 ) {
|
||||
show = false
|
||||
@@ -39,9 +39,9 @@ HImage {
|
||||
return
|
||||
}
|
||||
|
||||
let method = image.thumbnail ? "get_thumbnail" : "get_media"
|
||||
let args = image.thumbnail ?
|
||||
[image.mxc, w, h, cryptDict] : [image.mxc, cryptDict]
|
||||
const method = image.thumbnail ? "get_thumbnail" : "get_media"
|
||||
const args = image.thumbnail ?
|
||||
[image.mxc, w, h, cryptDict] : [image.mxc, cryptDict]
|
||||
|
||||
py.callCoro("media_cache." + method, args, path => {
|
||||
if (! image) return
|
||||
|
@@ -25,9 +25,9 @@ FocusScope {
|
||||
]
|
||||
|
||||
readonly property string joinedSelection: {
|
||||
let toCopy = []
|
||||
const toCopy = []
|
||||
|
||||
for (let key of Object.keys(selectedTexts).sort()) {
|
||||
for (const key of Object.keys(selectedTexts).sort()) {
|
||||
if (! selectedTexts[key]) continue
|
||||
|
||||
// For some dumb reason, Object.keys convert the floats to strings
|
||||
@@ -53,7 +53,7 @@ FocusScope {
|
||||
selecting = false
|
||||
}
|
||||
onDragPointChanged: {
|
||||
let pos = mapFromItem(
|
||||
const pos = mapFromItem(
|
||||
mainUI, eventPoint.scenePosition.x, eventPoint.scenePosition.y,
|
||||
)
|
||||
draggedItem.x = pos.x
|
||||
|
Reference in New Issue
Block a user