Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 73c5275

Browse files
fix: wrong message handler.
1 parent 6b28fa3 commit 73c5275

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

‎webviews/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function App() {
5353
await onRefreshStatus();
5454
}, 30 * 1000);
5555
}
56-
}, 5 * 1000);
56+
}, 3 * 1000);
5757

5858
return () => {
5959
window.clearTimeout(statusChecker.current);

‎webviews/components/mr/AddComment.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ function AddComment() {
3636
const showAllowMergeBtn = mrStatusOk && mergeRequest?.author?.id !== user?.id;
3737

3838
const getAgreed = () => {
39-
let agreed = true;
4039
const index = reviewers.reviewers.findIndex((r) => r.reviewer.id === user.id);
41-
40+
letagreed=reviewers.volunteer_reviewers.findIndex((r)=>r.reviewer.id===user.id)>=0;
4241
if (index >= 0) {
4342
agreed = reviewers.reviewers[index].value === 100;
44-
} else {
45-
agreed = reviewers.volunteer_reviewers.findIndex((r) => r.reviewer.id === user.id) >= 0;
4643
}
44+
4745
return agreed;
4846
};
4947

‎webviews/components/mr/StatusCheck.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function StatusCheck(props: Props) {
5959
);
6060
})
6161
) : (
62-
<li>No related job(s) found</li>
62+
<li>No related job found</li>
6363
)}
6464
</ul>
6565
</>

‎webviews/utils/message.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { vscode } from 'webviews/constants/vscode';
2+
import { nanoid } from 'nanoid';
23
import { IRequestMessage, IReplyMessage } from 'src/typings/message';
34

45
export class MessageHandler {
56
private _commandHandler: ((message: any) => void) | null;
6-
private lastSentReq: number;
7+
// private lastSentReq: string;
78
private pendingReplies: any;
89

910
constructor(commandHandler: any) {
1011
this._commandHandler = commandHandler;
11-
this.lastSentReq = 0;
12+
// this.lastSentReq = nanoid();
1213
this.pendingReplies = Object.create(null);
1314
window.addEventListener('message', this.handleMessage.bind(this));
1415
}
@@ -18,7 +19,7 @@ export class MessageHandler {
1819
}
1920

2021
public async postMessage(message: any): Promise<any> {
21-
const req = String(++this.lastSentReq);
22+
const req = nanoid();
2223
return new Promise<any>((resolve, reject) => {
2324
this.pendingReplies[req] = {
2425
resolve: resolve,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /