mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-09 19:55:34 +00:00
added /config endpoint, use fewer globals (#1172)
* added /config endpoint, use fewer globals * fixed integration tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* global Android LIMITS */
|
||||
/* global Android */
|
||||
|
||||
const html = require('choo/html');
|
||||
const raw = require('choo/html/raw');
|
||||
@@ -390,7 +390,7 @@ module.exports.empty = function(state, emit) {
|
||||
: html`
|
||||
<p class="center font-medium text-xs text-grey-dark mt-4 mb-2">
|
||||
${state.translate('signInSizeBump', {
|
||||
size: bytes(LIMITS.MAX_FILE_SIZE, 0)
|
||||
size: bytes(state.LIMITS.MAX_FILE_SIZE, 0)
|
||||
})}
|
||||
</p>
|
||||
`;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* globals DEFAULTS */
|
||||
const html = require('choo/html');
|
||||
const raw = require('choo/html/raw');
|
||||
const { secondsToL10nId } = require('../utils');
|
||||
@@ -21,7 +20,7 @@ module.exports = function(state, emit) {
|
||||
return el;
|
||||
}
|
||||
|
||||
const counts = DEFAULTS.DOWNLOAD_COUNTS.filter(
|
||||
const counts = state.DEFAULTS.DOWNLOAD_COUNTS.filter(
|
||||
i => state.capabilities.account || i <= state.user.maxDownloads
|
||||
);
|
||||
|
||||
@@ -45,7 +44,7 @@ module.exports = function(state, emit) {
|
||||
dlCountSelect
|
||||
);
|
||||
|
||||
const expires = DEFAULTS.EXPIRE_TIMES_SECONDS.filter(
|
||||
const expires = state.DEFAULTS.EXPIRE_TIMES_SECONDS.filter(
|
||||
i => state.capabilities.account || i <= state.user.maxExpireSeconds
|
||||
);
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
/* global LIMITS */
|
||||
const html = require('choo/html');
|
||||
const { bytes, platform } = require('../utils');
|
||||
const { canceledSignup, submittedSignup } = require('../metrics');
|
||||
|
||||
const DAYS = Math.floor(LIMITS.MAX_EXPIRE_SECONDS / 86400);
|
||||
|
||||
module.exports = function(trigger) {
|
||||
return function(state, emit, close) {
|
||||
const DAYS = Math.floor(state.LIMITS.MAX_EXPIRE_SECONDS / 86400);
|
||||
const hidden = platform() === 'android' ? 'hidden' : '';
|
||||
let submitting = false;
|
||||
return html`
|
||||
@@ -14,7 +12,7 @@ module.exports = function(trigger) {
|
||||
<h2 class="font-bold">${state.translate('accountBenefitTitle')}</h3>
|
||||
<ul class="my-2 leading-normal list-reset text-lg mb-8 mt-4">
|
||||
<li>${state.translate('accountBenefitLargeFiles', {
|
||||
size: bytes(LIMITS.MAX_FILE_SIZE)
|
||||
size: bytes(state.LIMITS.MAX_FILE_SIZE)
|
||||
})}</li>
|
||||
<li>${state.translate('accountBenefitExpiry')}</li>
|
||||
<li>${state.translate('accountBenefitExpiryTwo', { count: DAYS })}</li>
|
||||
|
||||
Reference in New Issue
Block a user