Skip to content

Commit

Permalink
ES6: Migrated ephemeralTimings (#950)
Browse files Browse the repository at this point in the history
  • Loading branch information
lipis authored Mar 27, 2017
1 parent 32099c7 commit fe31732
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 43 deletions.
43 changes: 0 additions & 43 deletions app/script/ephemeral/ephemeralTimings.coffee

This file was deleted.

40 changes: 40 additions & 0 deletions app/script/ephemeral/ephemeralTimings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
*/

'use strict';

window.z = window.z || {};
window.z.ephemeral = z.ephemeral || {};

z.ephemeral.timings = (() => {
const timings = [
1000 * 5,
1000 * 15,
1000 * 30,
1000 * 60,
1000 * 60 * 5,
1000 * 60 * 60 * 24,
];
const get_values = () => timings;
const map_to_closest_timing = milliseconds => z.util.ArrayUtil.find_closest(timings, milliseconds);
return {
get_values,
map_to_closest_timing,
};
})();

0 comments on commit fe31732

Please sign in to comment.