Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/custom-functions/v3/bcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ export function bcode(
}

const setting = Setting.load()
if (!setting.token) {
throw new Error('<<APIキーが有効ではありません>>')
if (setting.token === null) {
throw new Error('<<APIキーの読み取りに失敗しました>>')
}

if (setting.token === '') {
throw new Error('<<APIキーが設定されていません>>')
}

if (typeof intent === 'string' && intent.toUpperCase() === Setting.companyIntent) {
Expand Down
4 changes: 2 additions & 2 deletions src/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export class Setting {
static readonly companyIntent = 'COMPANY'

private constructor(
private _token: string,
private _token: string | null,
private _ondemandApiEnabled: boolean,
private _ondemandApiCallMode: 'default' | 'force'
) {}

public get token(): string {
public get token(): string | null {
return this._token
}

Expand Down