Merge branch 'clearnet' into tls-fix
commit
3964e9acf0
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 131 KiB |
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="129px" height="89px" viewBox="0 0 129 89" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 62 (91390) - https://sketch.com -->
|
||||
<title>Combined Shape</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Desktop-(Dark)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="OnboardingOpenGroupJoin" transform="translate(-168.000000, -235.000000)">
|
||||
<g id="Combined-Shape" transform="translate(170.000000, 236.000000)">
|
||||
<path d="M82.281886,20 C106.03013,20 125.281886,34.7746033 125.281886,53 C125.281886,59.5808228 122.771868,65.7117359 118.446468,70.8596473 C118.386871,73.4480518 120.309061,77.1248835 124.21251,81.8902344 C120.039982,81.5926483 116.036545,81.0288787 112.202199,80.1989258 C110.522391,79.8353273 109.249113,79.5109067 108.382366,79.2256639 C101.146682,83.4755303 92.0984313,86 82.281886,86 C58.5336418,86 39.281886,71.2253967 39.281886,53 C39.281886,34.7746033 58.5336418,20 82.281886,20 Z" stroke="#02D370" stroke-width="3" stroke-linejoin="round"></path>
|
||||
<path d="M31.281886,1.13686838e-13 C48.4027133,1.13686838e-13 62.281886,10.9690236 62.281886,24.5 C62.281886,38.0309764 48.4027133,49 31.281886,49 C24.1228438,49 17.530598,47.0820895 12.2828822,43.860929 C11.6699441,44.0982914 10.6509168,44.3755915 9.22632153,44.6931419 C6.46202578,45.3093191 3.57582702,45.7278752 0.567725244,45.9488104 C3.76733392,41.9262539 5.12046225,38.9484139 4.62711023,37.0152905 C1.86698023,33.3528537 0.281886022,29.0727229 0.281886022,24.5 C0.281886022,10.9690236 14.1610588,1.13686838e-13 31.281886,1.13686838e-13 Z" stroke="#161616" stroke-width="2" fill="#FFFFFF" fill-rule="evenodd"></path>
|
||||
<circle id="Oval" fill="#02D370" fill-rule="evenodd" cx="62" cy="53" r="4"></circle>
|
||||
<circle id="Oval" fill="#02D370" fill-rule="evenodd" cx="82" cy="53" r="4"></circle>
|
||||
<ellipse id="Oval" fill="#02D370" fill-rule="evenodd" cx="101.5" cy="53" rx="3.5" ry="4"></ellipse>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
@ -1,22 +1,62 @@
|
||||
/* global LokiAppDotNetServerAPI, LokiFileServerAPI, semver, log */
|
||||
// eslint-disable-next-line func-names
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
let BUILD_EXPIRATION = 0;
|
||||
try {
|
||||
BUILD_EXPIRATION = parseInt(window.getExpiration(), 10);
|
||||
if (BUILD_EXPIRATION) {
|
||||
window.log.info(
|
||||
'Build expires: ',
|
||||
new Date(BUILD_EXPIRATION).toISOString()
|
||||
);
|
||||
// hold last result
|
||||
let expiredVersion = null;
|
||||
|
||||
window.tokenlessFileServerAdnAPI = new LokiAppDotNetServerAPI(
|
||||
'', // no pubkey needed
|
||||
window.getDefaultFileServer()
|
||||
);
|
||||
window.tokenlessFileServerAdnAPI.pubKey = window.Signal.Crypto.base64ToArrayBuffer(
|
||||
LokiFileServerAPI.secureRpcPubKey
|
||||
);
|
||||
|
||||
const checkForUpgrades = async () => {
|
||||
const response = await window.tokenlessFileServerAdnAPI.serverRequest(
|
||||
'loki/v1/version/client/desktop'
|
||||
);
|
||||
if (response && response.response) {
|
||||
const latestVer = semver.clean(response.response.data[0][0]);
|
||||
if (semver.valid(latestVer)) {
|
||||
const ourVersion = window.getVersion();
|
||||
if (latestVer === ourVersion) {
|
||||
log.info('You have the latest version', latestVer);
|
||||
// change the following to true ot test/see expiration banner
|
||||
expiredVersion = false;
|
||||
} else {
|
||||
// expire if latest is newer than current
|
||||
expiredVersion = semver.gt(latestVer, ourVersion);
|
||||
if (expiredVersion) {
|
||||
log.info('There is a newer version available', latestVer);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// give it a minute
|
||||
log.warn('Could not check to see if newer version is available');
|
||||
setTimeout(async () => {
|
||||
await checkForUpgrades();
|
||||
}, 60 * 1000); // wait a minute
|
||||
}
|
||||
} catch (e) {
|
||||
// nothing
|
||||
}
|
||||
// no message logged means serverRequest never returned...
|
||||
};
|
||||
checkForUpgrades();
|
||||
|
||||
window.extension = window.extension || {};
|
||||
|
||||
window.extension.expired = () =>
|
||||
BUILD_EXPIRATION && Date.now() > BUILD_EXPIRATION;
|
||||
window.extension.expired = cb => {
|
||||
if (expiredVersion === null) {
|
||||
// just give it another second
|
||||
log.info('Delaying expire banner determination for 1s');
|
||||
setTimeout(() => {
|
||||
window.extension.expired(cb);
|
||||
}, 1000);
|
||||
return;
|
||||
}
|
||||
// yes we know
|
||||
cb(expiredVersion);
|
||||
};
|
||||
})();
|
||||
|
@ -1,12 +0,0 @@
|
||||
const Mixpanel = require('mixpanel');
|
||||
|
||||
class LokiMixpanelAPI {
|
||||
constructor() {
|
||||
this.mixpanel = Mixpanel.init('736cd9a854a157591153efacd1164e9a');
|
||||
}
|
||||
track(label) {
|
||||
this.mixpanel.track(label);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = LokiMixpanelAPI;
|
Loading…
Reference in New Issue