mirror of
https://github.com/Kenshin/simpread.git
synced 2026-01-25 14:28:34 +00:00
Optimize first and update auto create user logic.
This commit is contained in:
parent
2d03bcc726
commit
328e8547ca
@ -50,11 +50,10 @@ export default class AccountOpt extends React.Component {
|
||||
watch.SendMessage( "option", true );
|
||||
}, storage.simpread );
|
||||
}
|
||||
window.location.hash && window.location.hash.startsWith( "#firstload" ) && this.add();
|
||||
( this.props.load.first || this.props.load.update ) && this.add();
|
||||
}
|
||||
|
||||
add() {
|
||||
storage.user.uid = run.ID( "user" );
|
||||
$.ajax({
|
||||
url : storage.service + "/users/service/add/",
|
||||
method: "POST",
|
||||
|
||||
@ -36,6 +36,7 @@ import * as welc from 'welcome';
|
||||
import PureRead from 'puread';
|
||||
|
||||
let tabsItemID = 0,
|
||||
loadState = { first: false, update: false },
|
||||
website_sync = false; // when first and update checked versions.json
|
||||
|
||||
/**
|
||||
@ -135,8 +136,10 @@ function vernotify( first ) {
|
||||
|
||||
new Notify().Render( "简悦 版本提示", msg );
|
||||
|
||||
loadState = { first: true };
|
||||
if ( hash.startsWith( "#update?ver=" )) {
|
||||
watch.SendMessage( "version", true );
|
||||
loadState = { first: true, update: true };
|
||||
welcomeRender( false, version );
|
||||
}
|
||||
website_sync = true;
|
||||
@ -232,7 +235,7 @@ function tabsRender( color ) {
|
||||
</section>
|
||||
<section><Unrdist list={ storage.unrdist.map( item => { return { ...item }} ) } /></section>
|
||||
<section style={{ 'padding': '0;' }}>
|
||||
<AccountOps user={ storage.user } />
|
||||
<AccountOps user={ storage.user } load={ loadState } />
|
||||
</section>
|
||||
<section style={{ 'padding': '0;' }}><About option={ storage.option } site={ storage.simpread.sites.length } statistics={ storage.simpread.statistics } onClick={t=>welcomeRender(true)}/></section>
|
||||
</Tabs>,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user