Skip to content

Commit

Permalink
Remember acceptance for unsupported browsers.
Browse files Browse the repository at this point in the history
Addresses #3624.

This stores the flag in localStorage, after checking if localStorage is available. If localStorage is not available, the user will be prompted just like before this commit.

Signed-off-by: Travis Ralston <travpc@gmail.com>
  • Loading branch information
turt2live committed Apr 21, 2017
1 parent 2afe9e6 commit e877ad2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ async function loadApp() {
configError = e;
}

if (window.localStorage && window.localStorage.getItem('accepts_unsupported_browser')) {
console.log('User has previously accepted risks in using an unsupported browser');
validBrowser = true;
}

console.log("Vector starting at "+window.location);
if (configError) {
window.matrixChat = ReactDOM.render(<div className="error">
Expand Down Expand Up @@ -294,6 +299,7 @@ async function loadApp() {
var CompatibilityPage = sdk.getComponent("structures.CompatibilityPage");
window.matrixChat = ReactDOM.render(
<CompatibilityPage onAccept={function() {
if (window.localStorage) window.localStorage.setItem('accepts_unsupported_browser', true);
validBrowser = true;
console.log("User accepts the compatibility risks.");
loadApp();
Expand Down

0 comments on commit e877ad2

Please sign in to comment.