Skip to content

Commit 367b403

Browse files
committed
Add await
1 parent 4896fbb commit 367b403

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/actions/Action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface runArgs {
77
onSuccess?: onSuccessType
88
}
99

10-
type onSuccessType = (tweet: Tweet) => void;
10+
type onSuccessType = (tweet: Tweet) => Promise<void>;
1111

1212
export abstract class AbstractAction {
1313
config: BotConfig;

src/actions/Like.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class Like extends AbstractAction {
1919
this.debug('Liked!');
2020

2121
if (onSuccess) {
22-
onSuccess(tweet);
22+
await onSuccess(tweet);
2323
}
2424
} else {
2525
this.debug('Cannot like.');

src/actions/Retweet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class Retweet extends AbstractAction {
1919
this.debug('Retweeted!');
2020

2121
if (onSuccess) {
22-
onSuccess(tweet);
22+
await onSuccess(tweet);
2323
}
2424
} else {
2525
this.debug('Cannot retweet.');

src/actions/Search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default class Search extends AbstractAction {
3636
}
3737

3838
if (args.onSuccess) {
39-
args.onSuccess(tweet);
39+
await args.onSuccess(tweet);
4040
}
4141
}
4242
}

0 commit comments

Comments
 (0)