mirror of
https://github.com/Kenshin/simpread.git
synced 2026-01-25 14:28:34 +00:00
Optimize notify workflow.
This commit is contained in:
parent
09f5f1e0c2
commit
1e3cffa4a9
@ -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} 的授权,才能使用此功能!`, "授权", ()=>{
|
||||
|
||||
@ -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() ));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user