Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
ebe6ccea
Commit
ebe6ccea
authored
Nov 28, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v3' of github.com:mycard/mycard into v3
parents
ffb86554
8d119d4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
+22
-15
app/app-detail.component.ts
app/app-detail.component.ts
+21
-15
app/download.service.ts
app/download.service.ts
+1
-0
No files found.
app/app-detail.component.ts
View file @
ebe6ccea
...
...
@@ -90,22 +90,28 @@ export class AppDetailComponent implements OnInit {
try
{
let
downloadApps
=
await
this
.
downloadService
.
addUris
(
apps
,
downloadPath
);
for
(
let
app
of
apps
)
{
this
.
downloadService
.
getProgress
(
app
)
.
subscribe
((
progress
)
=>
{
app
.
status
.
status
=
"
downloading
"
;
app
.
status
.
progress
=
progress
.
progress
;
app
.
status
.
total
=
progress
.
total
;
this
.
ref
.
detectChanges
();
},
(
error
)
=>
{
},
()
=>
{
// 避免安装过快
if
(
app
.
status
.
status
===
"
downloading
"
)
{
app
.
status
.
status
=
"
waiting
"
;
await
new
Promise
((
resolve
,
reject
)
=>
{
this
.
downloadService
.
getProgress
(
app
)
.
subscribe
((
progress
)
=>
{
app
.
status
.
status
=
"
downloading
"
;
app
.
status
.
progress
=
progress
.
progress
;
app
.
status
.
total
=
progress
.
total
;
this
.
ref
.
detectChanges
();
}
});
resolve
();
},
(
error
)
=>
{
reject
(
`download error:
${
error
}
`
);
},
()
=>
{
// 避免安装过快
if
(
app
.
status
.
status
===
"
downloading
"
)
{
app
.
status
.
status
=
"
waiting
"
;
this
.
ref
.
detectChanges
();
}
});
});
}
await
Promise
.
all
(
downloadApps
.
map
((
app
)
=>
{
...
...
app/download.service.ts
View file @
ebe6ccea
...
...
@@ -59,6 +59,7 @@ export class DownloadService {
}
else
if
(
status
.
status
===
"
active
"
)
{
observer
.
next
({
total
:
status
.
totalLength
,
progress
:
status
.
completedLength
})
}
else
if
(
status
.
status
===
"
error
"
)
{
console
.
log
(
"
error
"
,
status
.
errorCode
);
observer
.
error
(
status
.
errorCode
)
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment