mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-19 07:32:22 +03:00
Just a couple of nits
This commit is contained in:
parent
ef8734d638
commit
ec193efd73
@ -89,7 +89,7 @@ export class AIService {
|
||||
private cloud: ReturnType<typeof getCloudApiClient>
|
||||
) {}
|
||||
|
||||
async configurationValid(userToken?: string) {
|
||||
async validateConfiguration(userToken?: string): Promise<boolean> {
|
||||
const modelKind = await this.gitConfig.getWithDefault<ModelKind>(
|
||||
GitAIConfigKey.ModelProvider,
|
||||
ModelKind.OpenAI
|
||||
@ -109,12 +109,12 @@ export class AIService {
|
||||
(modelKind == ModelKind.OpenAI && openAIKeyOption == KeyOption.ButlerAPI) ||
|
||||
(modelKind == ModelKind.Anthropic && anthropicKeyOption == KeyOption.ButlerAPI)
|
||||
) {
|
||||
return Boolean(userToken);
|
||||
return !!userToken;
|
||||
}
|
||||
|
||||
return Boolean(
|
||||
(modelKind == ModelKind.OpenAI && openAIKey) ||
|
||||
(modelKind == ModelKind.Anthropic && anthropicKey)
|
||||
return (
|
||||
(modelKind == ModelKind.OpenAI && !!openAIKey) ||
|
||||
(modelKind == ModelKind.Anthropic && !!anthropicKey)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@
|
||||
generateBranchName();
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
onMount(() => {
|
||||
laneWidth = lscache.get(laneWidthKey + branch.id);
|
||||
});
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
||||
$: setAIConfigurationValid($user);
|
||||
|
||||
async function setAIConfigurationValid(user: User | undefined) {
|
||||
aiConfigurationValid = await aiService.configurationValid(user?.access_token);
|
||||
aiConfigurationValid = await aiService.validateConfiguration(user?.access_token);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -139,7 +139,7 @@
|
||||
let aiConfigurationValid = false;
|
||||
|
||||
onMount(async () => {
|
||||
aiConfigurationValid = await aiService.configurationValid(user?.access_token);
|
||||
aiConfigurationValid = await aiService.validateConfiguration(user?.access_token);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user