style(ui): request that all types defined

- check in more restrictive mode = request types
- define main types in static/js/core/types.js
This commit is contained in:
Edouard Vanbelle
2026-04-30 02:02:27 +02:00
parent 97ea87efc2
commit 3050556dc0
29 changed files with 560 additions and 345 deletions
@@ -3,7 +3,7 @@ import { getCsrfHeaders } from '../../core/csrf.js';
(() => {
var API_BASE = window.location.origin;
var codeInput = document.getElementById('user-code');
var codeInput = /** @type {HTMLInputElement} */ (document.getElementById('user-code'));
var deviceInfo = document.getElementById('device-info');
var actionButtons = document.getElementById('action-buttons');
var errorText = document.getElementById('error-text');
+4
View File
@@ -6,6 +6,10 @@ var errorTitle = document.getElementById('error-title');
var errorMessage = document.getElementById('error-message');
var errorAction = document.getElementById('error-action');
if (!errorTitle || !errorMessage || !errorAction) {
throw new Error('missing html elements');
}
switch (errorType) {
case 'invalid-credentials':
errorTitle.textContent = 'Login Failed';
+6 -1
View File
@@ -10,10 +10,14 @@ import { formatDateShort } from '../../core/formatters.js';
import { i18n } from '../../core/i18n.js';
import { fileSharing } from '../../features/sharing/fileSharing.js';
/** @import {Share} from '../../core/types.js' */
const TTL = 5 * 60 * 1000; // 5 min
const sharedView = {
// State
/** @type {Array<Share>} */
items: [],
_expires: 0,
@@ -21,6 +25,7 @@ const sharedView = {
/** @type {Map<string, boolean>} key = "file:<id>" | "folder:<id>" */
_knownItemsId: new Map(),
/** @type {Array<Share>} */
filteredItems: [],
currentItem: null,
@@ -67,7 +72,7 @@ const sharedView = {
*
* @param {boolean} force ignore cache
*/
async loadItems(force) {
async loadItems(force = false) {
if (this._expires > Date.now() && !force) return;
try {