mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
update eslint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
@@ -27,7 +27,7 @@ export const createUmzug = (sequelize: Sequelize) => (
|
||||
resolve: ({ name, path }) => {
|
||||
if (!path) throw new Error()
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const migration = require(path)
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
@@ -89,7 +89,6 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
||||
addUsedTimeForADifferentUserThanTheCurrentUserOfTheDevice = true
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-inner-declarations
|
||||
async function handle (start: number, end: number) {
|
||||
const lengthInMinutes = (end - start) + 1
|
||||
const lengthInMs = lengthInMinutes * 1000 * 60
|
||||
@@ -215,10 +214,10 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
||||
|
||||
const fittingDurationItemsLastUsageFiltered =
|
||||
hasTrustedTimestamp ?
|
||||
fittingDurationItems.filter((it) => {
|
||||
fittingDurationItems.filter((it) => (
|
||||
action.trustedTimestamp - item.timeToAdd <=
|
||||
parseInt(it.lastUsage, 10) + it.sessionPauseDuration - tolerance
|
||||
}) : fittingDurationItems
|
||||
)) : fittingDurationItems
|
||||
|
||||
return fittingDurationItemsLastUsageFiltered
|
||||
.map((it) => it.lastSessionDuration)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
@@ -48,7 +48,8 @@ export const dispatchChildChangePassword = async ({ action, childUserId, cache }
|
||||
|
||||
{
|
||||
const clear = cache.getSecondPasswordHashOfChild.cache.clear
|
||||
clear && clear()
|
||||
|
||||
if (clear) clear()
|
||||
}
|
||||
|
||||
cache.invalidiateUserList = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
@@ -55,7 +55,8 @@ export async function dispatchChangeParentPassword ({ action, cache }: {
|
||||
|
||||
{
|
||||
const clear = cache.getSecondPasswordHashOfParent.cache.clear
|
||||
clear && clear()
|
||||
|
||||
if (clear) clear()
|
||||
}
|
||||
|
||||
cache.invalidiateUserList = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
@@ -47,7 +47,8 @@ export async function dispatchSetChildPassword ({ action, cache }: {
|
||||
|
||||
{
|
||||
const clear = cache.getSecondPasswordHashOfChild.cache.clear
|
||||
clear && clear()
|
||||
|
||||
if (clear) clear()
|
||||
}
|
||||
|
||||
cache.invalidiateUserList = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
@@ -56,7 +56,7 @@ export const createWebsocketHandler = ({ connectedDevicesManager, database }: {
|
||||
|
||||
const importantSyncForAllListener = () => {
|
||||
setTimeout(() => {
|
||||
socket.connected && socket.emit('should sync', { isImportant: true })
|
||||
if (socket.connected) socket.emit('should sync', { isImportant: true })
|
||||
}, Math.random() * 1000 * 60 /* wait up to one minute */)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user