blob: d58034d967d0fbae0be26cf8660b41e129c5cafb [file] [log] [blame]
<dom-module id="lgtm-plugin">
<script>
Gerrit.install(plugin => {
const replyApi = plugin.changeReply();
replyApi.addReplyTextChangedCallback(text => {
const label = 'Code-Review';
const labelValue = replyApi.getLabelValue(label);
if (labelValue &&
labelValue === ' 0' &&
text.indexOf('LGTM') === 0) {
replyApi.setLabelValue(label, '+1');
}
});
});
</script>
</dom-module>