Optimize notify workflow.

This commit is contained in:
Kenshin 2018-06-07 13:59:28 +08:00
parent 09f5f1e0c2
commit 1e3cffa4a9
2 changed files with 3 additions and 1 deletions

View File

@ -1054,7 +1054,7 @@ function verifyService( storage, service, type, name, notify, auto = true ) {
storage.Safe( ()=> {
if ( storage.secret[type].access_token ) {
Object.keys( storage.secret[type] ).forEach( item => service[item] = storage.secret[type][item] );
noti = notify.Render({ content: `开始保存到 ${name},请稍等...`, state: "loading" });
type != "linnk" && ( noti = notify.Render({ content: `开始保存到 ${name},请稍等...`, state: "loading" }));
dtd.resolve( type );
} else {
auto ? notify.Render( `请先获取 ${name} 的授权,才能使用此功能!`, "授权", ()=>{

View File

@ -142,7 +142,9 @@ function action( type, title, desc, content ) {
instapaper.Add( window.location.href, title, desc, ( result, error ) => exp.svcCbWrapper( result, error, instapaper.name, type, new Notify() ));
break;
case "linnk":
const notify = new Notify().Render({ content: `开始保存到 Linnk请稍等...`, state: "loading" });
linnk.GetSafeGroup( linnk.group_name, ( result, error ) => {
notify.complete();
if ( !error ) {
linnk.group_id = result.data.groupId;
linnk.Add( window.location.href, title, ( result, error ) => exp.svcCbWrapper( result, error, linnk.name, type, new Notify() ));