From ea47e68ebcfb3b5e970ae66ecf63ae930b36437e Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Tue, 7 Apr 2020 18:37:18 +0200 Subject: [PATCH] feat(github): adjust own update check --- .../github/github-common-interfaces.service.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/features/issue/providers/github/github-common-interfaces.service.ts b/src/app/features/issue/providers/github/github-common-interfaces.service.ts index 9a92112daf..57bc016912 100644 --- a/src/app/features/issue/providers/github/github-common-interfaces.service.ts +++ b/src/app/features/issue/providers/github/github-common-interfaces.service.ts @@ -54,8 +54,9 @@ export class GithubCommonInterfacesService implements IssueServiceInterface { const issue = await this._githubApiService.getById$(+task.issueId, cfg).toPromise(); const issueUpdate: number = new Date(issue.updated_at).getTime(); - const commentsByOthers = (cfg.filterUsername && cfg.filterUsername.length > 1) - ? issue.comments.filter(comment => comment.user.login !== cfg.filterUsername) + const filterUserName = cfg.filterUsername && cfg.filterUsername.toLowerCase(); + const commentsByOthers = (filterUserName && filterUserName.length > 1) + ? issue.comments.filter(comment => comment.user.login.toLowerCase() !== cfg.filterUsername) : issue.comments; // TODO: we also need to handle the case when the user himself updated the issue, to also update the issue... @@ -67,6 +68,11 @@ export class GithubCommonInterfacesService implements IssueServiceInterface { const wasUpdated = lastRemoteUpdate > (task.issueLastUpdated || 0); + // TODO remove after this is resolved + console.log('wasUpdated', wasUpdated, ' lastRemoteUpdate', lastRemoteUpdate); + console.log(isNotifySuccess, commentsByOthers, updates); + console.log('cfg', cfg); + if (wasUpdated && isNotifySuccess) { this._snackService.open({ ico: 'cloud_download',