fix: welcome background refresh, add more privacy tab content

This commit is contained in:
David Ralph 2021-07-18 12:20:35 +01:00
parent 332e6c33ac
commit 2d7e138b2f
13 changed files with 47 additions and 22 deletions

View File

@ -28,9 +28,9 @@ export default class About extends React.PureComponent {
let contributors, sponsors, photographers, versionData;
try {
versionData = await (await fetch(window.constants.GITHUB_URL + '/repos/' + window.constants.REPO_NAME + '/releases', { signal: this.controller.signal })).json();
versionData = await (await fetch(window.constants.GITHUB_URL + '/repos/' + window.constants.ORG_NAME + '/' + window.constants.REPO_NAME + '/releases', { signal: this.controller.signal })).json();
contributors = await (await fetch(window.constants.GITHUB_URL + '/repos/' + window.constants.REPO_NAME + '/contributors', { signal: this.controller.signal })).json();
contributors = await (await fetch(window.constants.GITHUB_URL + '/repos/'+ window.constants.ORG_NAME + '/' + window.constants.REPO_NAME + '/contributors', { signal: this.controller.signal })).json();
sponsors = (await (await fetch(window.constants.SPONSORS_URL + '/list', { signal: this.controller.signal })).json()).sponsors;
photographers = await (await fetch(window.constants.API_URL + '/images/photographers', { signal: this.controller.signal })).json();
@ -89,7 +89,7 @@ export default class About extends React.PureComponent {
<>
<h2>{this.language.title}</h2>
<img draggable='false' className='aboutLogo' src='./././icons/logo_horizontal.png' alt='Logo'></img>
<p>{this.language.copyright} {window.constants.COPYRIGHT_YEAR}-{new Date().getFullYear()} <a href={'https://github.com/repos/' + window.constants.REPO_NAME + '/graphs/contributors'} className='aboutLink' target='_blank' rel='noopener noreferrer'>{window.constants.COPYRIGHT_NAME}</a> ({window.constants.COPYRIGHT_LICENSE})</p>
<p>{this.language.copyright} {window.constants.COPYRIGHT_YEAR}-{new Date().getFullYear()} <a href={'https://github.com/repos/' + window.constants.ORG_NAME + '/' + window.constants.REPO_NAME + '/graphs/contributors'} className='aboutLink' target='_blank' rel='noopener noreferrer'>{window.constants.COPYRIGHT_NAME}</a> ({window.constants.COPYRIGHT_LICENSE})</p>
<p>{this.language.version.title} {window.constants.VERSION} ({this.state.update})</p>
<a href={window.constants.PRIVACY_URL} className='aboutLink' target='_blank' rel='noopener noreferrer'>{window.language.modals.welcome.sections.privacy.links.privacy_policy}</a>

View File

@ -129,7 +129,7 @@ export default class WelcomeSections extends React.PureComponent {
</>
);
const { appearance, advanced } = window.language.modals.main.settings.sections;
const { appearance, advanced, background, quicklinks } = window.language.modals.main.settings.sections;
const languageSettings = window.language.modals.main.settings.sections.language;
const theme = (
@ -178,8 +178,13 @@ export default class WelcomeSections extends React.PureComponent {
<p>{language.sections.privacy.description}</p>
<Checkbox name='offlineMode' text={advanced.offline_mode} element='.other' />
<p>{language.sections.privacy.offline_mode_description}</p>
<Checkbox name='quicklinksddgProxy' text={background.ddg_image_proxy + ' (' + quicklinks.title + ')'}/>
<Checkbox name='ddgProxy' text={background.ddg_image_proxy + ' (' + background.title + ')'}/>
<p>{language.sections.privacy.ddg_proxy_description}</p>
<h3 className='quicktip'>{language.sections.privacy.links.title}</h3>
<a className='privacy' href={window.constants.PRIVACY_URL} target='_blank' rel='noopener noreferrer'>{language.sections.privacy.links.privacy_policy}</a>
<br/><br/>
<a className='privacy' href={'https://github.com/' + window.constants.ORG_NAME} target='_blank' rel='noopener noreferrer'>{language.sections.privacy.links.source_code}</a>
</>
);

View File

@ -1,4 +1,4 @@
// warning: the code here is fairly messy and probably needs a rewrite
// todo: rewrite this mess
import React from 'react';
import EventBus from '../../../modules/helpers/eventbus';
@ -283,11 +283,6 @@ export default class Background extends React.PureComponent {
this.getBackground();
};
const welcomeTab = localStorage.getItem('welcomeTab');
if (welcomeTab) {
return this.setState(JSON.parse(localStorage.getItem('welcomeImage')));
}
EventBus.on('refresh', (data) => {
if (data === 'welcomeLanguage') {
localStorage.setItem('welcomeImage', JSON.stringify(this.state));
@ -349,6 +344,10 @@ export default class Background extends React.PureComponent {
}
});
if (localStorage.getItem('welcomeTab')) {
return this.setState(JSON.parse(localStorage.getItem('welcomeImage')));
}
const interval = localStorage.getItem('backgroundchange');
if (interval && interval !== 'refresh') {
Interval(() => {
@ -363,7 +362,9 @@ export default class Background extends React.PureComponent {
try {
this.setState(JSON.parse(localStorage.getItem('currentBackground')));
} catch (e) { this.setBackground(); }
} catch (e) {
this.setBackground();
}
} else {
this.getBackground();
}

View File

@ -15,7 +15,8 @@ export const BLOG_POST = 'https://blog.muetab.com/posts/version-5-1';
export const FEEDBACK_FORM = 'https://api.formcake.com/api/form/349b56cb-7e2b-4004-b32b-e8964d217dd1/submission';
// Mue Info
export const REPO_NAME = 'mue/mue';
export const ORG_NAME = 'mue';
export const REPO_NAME = 'mue';
export const EMAIL = 'hello@muetab.com';
export const TWITTER_HANDLE = 'getmue';
export const INSTAGRAM_HANDLE = 'mue.tab';
@ -24,7 +25,7 @@ export const DISCORD_SERVER = 'zv8C9F8';
export const COPYRIGHT_NAME = 'The Mue Authors';
export const COPYRIGHT_YEAR = '2018';
export const COPYRIGHT_LICENSE = 'BSD-3 License';
export const DONATE_USERNAME = 'davidjcralph';
export const DONATE_USERNAME = 'davidjcralph'; // this only works if you use the same username for Patreon, GitHub and Ko-Fi
// umami
export const UMAMI_DOMAIN = 'https://umami.muetab.com';

View File

@ -412,9 +412,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {

View File

@ -412,9 +412,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {

View File

@ -412,9 +412,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {

View File

@ -412,9 +412,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {

View File

@ -412,9 +412,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {

View File

@ -412,9 +412,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {

View File

@ -412,9 +412,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {

View File

@ -413,9 +413,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {

View File

@ -412,9 +412,11 @@
"title": "Privacy Options",
"description": "Enable settings to further protect your privacy with Mue.",
"offline_mode_description": "Enabling offline mode will disable all requests to any service. This will result in online backgrounds, online quotes, marketplace, weather, quick links, change log and some about tab information to be disabled.",
"ddg_proxy_description": "You can make image requests go through DuckDuckGo if you wish. By default, API requests go through our open source servers and image requests go through the original server. Turning this off for quick links will get the icons from Google instead of DuckDuckGo. DuckDuckGo proxy is always enabled for the Marketplace.",
"links": {
"title": "Links",
"privacy_policy": "Privacy Policy"
"privacy_policy": "Privacy Policy",
"source_code": "Source Code"
}
},
"final": {