From 71ea4e74f6e991b11eb86d3babf8e398ca9a07fa Mon Sep 17 00:00:00 2001 From: Donovan Preston Date: Thu, 6 Sep 2018 18:56:04 -0400 Subject: [PATCH] Implement wss preference url in html; Update to work with the tip of vnext branch; allow viewing the android ui from the webpack server (#918) * Merge branch 'vnext' of https://github.com/mozilla/send into android-preferences Fix conflicts * Implement wss preference url in html; Update to work with the tip of vnext branch; allow viewing the android ui from the webpack server * Use a try/catch in case localStorage isn't available, which it isn't in a ServiceWorker --- android/android.js | 19 +++++++++++++- android/app/app.iml | 4 +-- android/app/src/main/assets/index.css | 4 +++ android/pages/home.js | 12 +++++++++ android/pages/preferences.js | 36 +++++++++++++++++++++++++++ android/stores/state.js | 7 +++++- app/api.js | 21 +++++++++++++++- 7 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 android/pages/preferences.js diff --git a/android/android.js b/android/android.js index ac645287..7a9ac3f4 100644 --- a/android/android.js +++ b/android/android.js @@ -1,6 +1,21 @@ /* global window */ -window.MAXFILESIZE = 1024 * 1024 * 1024 * 2; +window.LIMITS = { + ANON: { + MAX_FILE_SIZE: 1024 * 1024 * 1024 * 2, + MAX_DOWNLOADS: 32, + MAX_EXPIRE_SECONDS: 604800 + }, + MAX_FILE_SIZE: 1024 * 1024 * 1024 * 2, + MAX_DOWNLOADS: 32, + MAX_EXPIRE_SECONDS: 604800, + MAX_FILES_PER_ARCHIVE: 32, + MAX_ARCHIVES_PER_USER: 32 +}; + +window.DEFAULTS = { + EXPIRE_SECONDS: 3600 +}; const choo = require('choo'); const app = choo(); @@ -11,4 +26,6 @@ app.use(require('./stores/intents').default); app.route('/', require('./pages/home').default); app.route('/upload', require('./pages/upload').default); app.route('/share/:id', require('./pages/share').default); +app.route('/preferences', require('./pages/preferences').default); +app.route('/android/app/src/main/assets', require('./pages/home').default); app.mount('body'); diff --git a/android/app/app.iml b/android/app/app.iml index 4554de11..42cb679c 100644 --- a/android/app/app.iml +++ b/android/app/app.iml @@ -22,14 +22,13 @@ - +