mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-10 19:46:34 +03:00
Take ifFirstInstall into account
This commit is contained in:
parent
c3a641d85f
commit
4e6508a058
|
@ -20,10 +20,9 @@ export default function getApp(theState) {
|
|||
|
||||
const hash = window.location.hash.substr(1);
|
||||
const hashParams = new URLSearchParams(hash);
|
||||
console.log('GOT from', hash, hashParams.toString());
|
||||
|
||||
this.state = {
|
||||
status: hashParams.get('status') || 'Загрузка...',
|
||||
status: hashParams.get('status') || 'Хорошего настроения вам!',
|
||||
ifInputsDisabled: false,
|
||||
hashParams,
|
||||
};
|
||||
|
|
|
@ -21,8 +21,6 @@ export default function getMain(theState) {
|
|||
const ApplyMods = getApplyMods(theState);
|
||||
const Notifications = getNotifications(theState);
|
||||
|
||||
//const addChecks = (arr) => arr.map( (conf) => Object.assign(conf, {ifChecked: Boolean(conf.value)}) );
|
||||
|
||||
const checksName = 'pacMods';
|
||||
|
||||
return class Main extends Component {
|
||||
|
|
|
@ -60,6 +60,14 @@ export default function getPacChooser(theState) {
|
|||
chosenPacName: 'none',
|
||||
};
|
||||
|
||||
this.updatePac = function updatePac() {
|
||||
props.funs.conduct(
|
||||
'Обновляем...',
|
||||
(cb) => props.apis.antiCensorRu.syncWithPacProviderAsync(cb),
|
||||
'Обновлено.'
|
||||
);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
getCurrentProviderId() {
|
||||
|
@ -103,14 +111,6 @@ export default function getPacChooser(theState) {
|
|||
|
||||
render(props) {
|
||||
|
||||
const updatePac = function updatePac() {
|
||||
props.funs.conduct(
|
||||
'Обновляем...',
|
||||
(cb) => props.apis.antiCensorRu.syncWithPacProviderAsync(cb),
|
||||
'Обновлено.'
|
||||
);
|
||||
};
|
||||
|
||||
const iddyToCheck = this.getCurrentProviderId();
|
||||
return (
|
||||
<div>
|
||||
|
@ -125,7 +125,12 @@ export default function getPacChooser(theState) {
|
|||
name="pacProvider"
|
||||
checked={iddyToCheck === provConf.key}
|
||||
disabled={props.ifInputsDisabled}
|
||||
nodeAfterLabel={<a href="" class={scopedCss.updateButton} onClick={(evt) => { evt.preventDefault(); updatePac(); }}>[обновить]</a>}
|
||||
nodeAfterLabel={<a href="" class={scopedCss.updateButton} onClick={(evt) => {
|
||||
|
||||
evt.preventDefault();
|
||||
this.updatePac();
|
||||
|
||||
}}>[обновить]</a>}
|
||||
/>)
|
||||
)
|
||||
}
|
||||
|
@ -147,6 +152,14 @@ export default function getPacChooser(theState) {
|
|||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
if (this.props.apis.antiCensorRu.ifFirstInstall) {
|
||||
this.updatePac();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user