This commit is contained in:
Will Hunt 2021-11-22 17:38:39 +00:00
parent b77916f425
commit ce34ff2bd3
3 changed files with 7 additions and 7 deletions

View File

@ -28,12 +28,12 @@ export class GitHubDiscussionSpace implements IConnection {
static readonly QueryRoomRegex = /#github_disc_(.+)_(.+):.*/;
static async onQueryRoom(result: RegExpExecArray, opts: {octokit: Octokit, as: Appservice}): Promise<Record<string, unknown>> {
if (!result) {
log.error("Invalid alias pattern");
if (!result || result.length < 2) {
log.error(`Invalid alias pattern '${result}'`);
throw Error("Could not find issue");
}
const [ owner, repo ] = result?.slice(1);
const [ owner, repo ] = result.slice(1);
log.info(`Fetching ${owner}/${repo}`);
let repoRes: ReposGetResponseData;

View File

@ -315,7 +315,7 @@ export class GitHubIssueConnection implements IConnection {
}
}
public onIssueStateChange(data: unknown) {
public onIssueStateChange() {
return this.syncIssueState();
}

View File

@ -26,12 +26,12 @@ export class GitHubUserSpace implements IConnection {
static readonly QueryRoomRegex = /#github_(.+):.*/;
static async onQueryRoom(result: RegExpExecArray, opts: {octokit: Octokit, as: Appservice}): Promise<Record<string, unknown>> {
if (!result) {
log.error("Invalid alias pattern");
if (!result || result.length < 1) {
log.error(`Invalid alias pattern '${result}'`);
throw Error("Could not find issue");
}
const [ username ] = result?.slice(1);
const [ username ] = result.slice(1);
log.info(`Fetching ${username}`);
let state: GitHubUserSpaceConnectionState;