Skip to content

Commit

Permalink
Fixed an errors list.
Browse files Browse the repository at this point in the history
Plastiquewind committed Apr 6, 2018
1 parent b098c54 commit f44c106
Showing 11 changed files with 34 additions and 29 deletions.
22 changes: 11 additions & 11 deletions app.9e39bf5f0c01dfbb7773.js → app.549bca09d1373532a3bf.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app.549bca09d1373532a3bf.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion app.9e39bf5f0c01dfbb7773.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -21,6 +21,6 @@
<span>Загрузка...</span>
</div>
<script src="https://apis.google.com/js/api.js"></script>
<script type="text/javascript" src="/vendor.9e39bf5f0c01dfbb7773.js"></script><script type="text/javascript" src="/app.9e39bf5f0c01dfbb7773.js"></script></body>
<script type="text/javascript" src="/vendor.549bca09d1373532a3bf.js"></script><script type="text/javascript" src="/app.549bca09d1373532a3bf.js"></script></body>

</html>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "youlikeapp",
"version": "1.4.1",
"version": "1.4.2",
"author": {
"name": "Plastiquewind"
},
2 changes: 1 addition & 1 deletion src/app/common/youtube/index.ts
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ const YouTube: ng.IModule = angular
};

$delegate.checkVideos = youtubeWrapper($delegate.checkVideos, 60);
$delegate.setRating = youtubeWrapper($delegate.setRating, 60 * 60 * 6);
$delegate.setRating = youtubeWrapper($delegate.setRating, 60 * 5);

return $delegate;
});
19 changes: 11 additions & 8 deletions src/app/components/main/main.component.ts
Original file line number Diff line number Diff line change
@@ -78,21 +78,22 @@ class MainController implements ng.IComponentController {

this.clearStats();

this.lastSuccessedVideos = [];
this.lastFailedVideos = [];
let lastSuccessedVideos: string[] = [];
let lastFailedVideos: { id: string; errorMsg: string }[] = [];

try {
this.youtubeService.setRating(lastCheckingResult.withoutLikes, "like",
(videoId: string) => {
this.lastSuccessedVideos.push(videoId);

this.$scope.$apply();
lastSuccessedVideos.push(videoId);
},
(videoId: string, errorMsg: string) => {
this.lastFailedVideos.push({ id: videoId, errorMsg: errorMsg });
lastFailedVideos.push({ id: videoId, errorMsg: errorMsg });
}).then(() => {
this.lastSuccessedVideos = lastSuccessedVideos;
this.lastFailedVideos = lastFailedVideos;

this.$scope.$apply();
}).then(() => this.$scope.$apply(() => this.blockUI.stop()));
this.$scope.$apply(() => this.blockUI.stop());
});
} catch {
this.clearStats();
this.blockUI.stop();
@@ -112,6 +113,8 @@ class MainController implements ng.IComponentController {
contentElement: `#${id}`,
parent: document.body
});

console.log((<any>this).lastFailedVideosShown);
}

public closeDialog(): void {
6 changes: 4 additions & 2 deletions src/app/components/main/main.html
Original file line number Diff line number Diff line change
@@ -101,7 +101,8 @@ <h2>Список видео без лайков</h2>
</a>
</md-list-item>
</md-list>
<md-collection-pagination collection="$ctrl.lastCheckingResult.withoutLikes"
<md-collection-pagination ng-if="$ctrl.lastCheckingResult.withoutLikes"
collection="$ctrl.lastCheckingResult.withoutLikes"
paginated-collection="$ctrl.lastCheckingResult.withoutLikesShown">
</md-collection-pagination>
</md-dialog-content>
@@ -129,7 +130,8 @@ <h2>Ошибки</h2>
</p>
</md-list-item>
</md-list>
<md-collection-pagination collection="$ctrl.lastFailedVideos"
<md-collection-pagination ng-if="$ctrl.lastFailedVideos"
collection="$ctrl.lastFailedVideos"
paginated-collection="$ctrl.lastFailedVideosShown">
</md-collection-pagination>
</md-dialog-content>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit f44c106

Please sign in to comment.