parseInt
This commit is contained in:
parent
8bcc43905a
commit
0745ccf995
7 changed files with 15 additions and 15 deletions
|
|
@ -109,7 +109,7 @@ export const promisedRequest = async ({
|
||||||
.get('content-type')
|
.get('content-type')
|
||||||
.split(';')
|
.split(';')
|
||||||
.map((x) => x.toLowerCase().trim())
|
.map((x) => x.toLowerCase().trim())
|
||||||
const contentLength = parseInt(response.headers.get('content-length'))
|
const contentLength = Number.parseInt(response.headers.get('content-length'))
|
||||||
if (contentLength === 0) return null
|
if (contentLength === 0) return null
|
||||||
|
|
||||||
switch (contentType) {
|
switch (contentType) {
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ export const postStatus = ({
|
||||||
})
|
})
|
||||||
if (pollOptions.some((option) => option !== '')) {
|
if (pollOptions.some((option) => option !== '')) {
|
||||||
const normalizedPoll = {
|
const normalizedPoll = {
|
||||||
expires_in: parseInt(poll.expiresIn, 10),
|
expires_in: Number.parseInt(poll.expiresIn, 10),
|
||||||
multiple: poll.multiple,
|
multiple: poll.multiple,
|
||||||
}
|
}
|
||||||
Object.keys(normalizedPoll).forEach((key) => {
|
Object.keys(normalizedPoll).forEach((key) => {
|
||||||
|
|
@ -278,7 +278,7 @@ export const editStatus = ({
|
||||||
|
|
||||||
if (pollOptions.some((option) => option !== '')) {
|
if (pollOptions.some((option) => option !== '')) {
|
||||||
const normalizedPoll = {
|
const normalizedPoll = {
|
||||||
expires_in: parseInt(poll.expiresIn, 10),
|
expires_in: Number.parseInt(poll.expiresIn, 10),
|
||||||
multiple: poll.multiple,
|
multiple: poll.multiple,
|
||||||
}
|
}
|
||||||
Object.keys(normalizedPoll).forEach((key) => {
|
Object.keys(normalizedPoll).forEach((key) => {
|
||||||
|
|
|
||||||
|
|
@ -353,19 +353,19 @@ const getNodeInfo = async ({ store }) => {
|
||||||
const uploadLimits = metadata.uploadLimits
|
const uploadLimits = metadata.uploadLimits
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
path: 'limits.uploadlimit',
|
path: 'limits.uploadlimit',
|
||||||
value: parseInt(uploadLimits.general),
|
value: Number.parseInt(uploadLimits.general),
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
path: 'limits.avatarlimit',
|
path: 'limits.avatarlimit',
|
||||||
value: parseInt(uploadLimits.avatar),
|
value: Number.parseInt(uploadLimits.avatar),
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
path: 'limits.backgroundlimit',
|
path: 'limits.backgroundlimit',
|
||||||
value: parseInt(uploadLimits.background),
|
value: Number.parseInt(uploadLimits.background),
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
path: 'limits.bannerlimit',
|
path: 'limits.bannerlimit',
|
||||||
value: parseInt(uploadLimits.banner),
|
value: Number.parseInt(uploadLimits.banner),
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
path: 'limits.fieldsLimits',
|
path: 'limits.fieldsLimits',
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export default {
|
||||||
...Setting.methods,
|
...Setting.methods,
|
||||||
getValue(e) {
|
getValue(e) {
|
||||||
if (!this.truncate === 1) {
|
if (!this.truncate === 1) {
|
||||||
return parseInt(e.target.value)
|
return Number.parseInt(e.target.value)
|
||||||
} else if (this.truncate > 1) {
|
} else if (this.truncate > 1) {
|
||||||
return Math.trunc(e.target.value / this.truncate) * this.truncate
|
return Math.trunc(e.target.value / this.truncate) * this.truncate
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -173,9 +173,9 @@ export const hex2rgb = (hex) => {
|
||||||
|
|
||||||
return result
|
return result
|
||||||
? {
|
? {
|
||||||
r: parseInt(result[1], 16),
|
r: Number.parseInt(result[1], 16),
|
||||||
g: parseInt(result[2], 16),
|
g: Number.parseInt(result[2], 16),
|
||||||
b: parseInt(result[3], 16),
|
b: Number.parseInt(result[3], 16),
|
||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,7 @@ export const parseNotification = (data) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
output.created_at = new Date(data.created_at)
|
output.created_at = new Date(data.created_at)
|
||||||
output.id = parseInt(data.id)
|
output.id = Number.parseInt(data.id)
|
||||||
|
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
@ -385,8 +385,8 @@ export const parseLinkHeaderPagination = (linkHeader, opts = {}) => {
|
||||||
const minId = parsedLinkHeader.prev?.min_id
|
const minId = parsedLinkHeader.prev?.min_id
|
||||||
|
|
||||||
return {
|
return {
|
||||||
maxId: flakeId ? maxId : parseInt(maxId, 10),
|
maxId: flakeId ? maxId : Number.parseInt(maxId, 10),
|
||||||
minId: flakeId ? minId : parseInt(minId, 10),
|
minId: flakeId ? minId : Number.parseInt(minId, 10),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ const extractStyleConfig = ({
|
||||||
contentColumnWidth,
|
contentColumnWidth,
|
||||||
notifsColumnWidth,
|
notifsColumnWidth,
|
||||||
themeEditorMinWidth:
|
themeEditorMinWidth:
|
||||||
parseInt(themeEditorMinWidth) === 0 ? 'fit-content' : themeEditorMinWidth,
|
Number.parseInt(themeEditorMinWidth) === 0 ? 'fit-content' : themeEditorMinWidth,
|
||||||
emojiReactionsScale,
|
emojiReactionsScale,
|
||||||
emojiSize,
|
emojiSize,
|
||||||
navbarSize,
|
navbarSize,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue