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