Skip to content

Commit 9efa31b

Browse files
authored
Merge pull request #6 from its-so-cold/passwd
Password addon input
2 parents 17fd303 + c5d0735 commit 9efa31b

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/addons/addons/ai-integration/_manifest_entry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ const manifest = {
2424
{
2525
"id": "GeminiAPIKey",
2626
"name": "Gemini API Key",
27-
"type": "long_string",
27+
"type": "long_password",
2828
"default": "",
2929
},
3030
{
3131
"id": "OpenRouterAPIKey",
3232
"name": "OpenRouter API Key",
33-
"type": "long_string",
33+
"type": "long_password",
3434
"default": "",
3535
}
3636
],

src/addons/settings/settings.jsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2021-2023 Thomas Weber
2+
* Copyright (C) 2021-2026 Thomas Weber
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License version 3 as
@@ -428,23 +428,24 @@ const Setting = ({
428428
/>
429429
</React.Fragment>
430430
)}
431-
{(setting.type === 'string' || setting.type === 'long_string' || setting.type === 'untranslated') && (
431+
{(setting.type === 'string' || setting.type === 'long_string' || setting.type === 'untranslated' ||
432+
setting.type === 'password' || setting.type === 'long_password') && (
432433
<React.Fragment>
433434
{label}
434435
<TextInput
435436
id={uniqueId}
436-
type="text"
437+
type={setting.type === 'password' || setting.type === 'long_password' ? 'password' : 'text'}
437438
value={value}
438-
className={setting.type === 'long_string' ? styles.longStringSetting : ''}
439+
className={setting.type === 'long_string' || setting.type === 'long_password' ? styles.longStringSetting : ''}
439440
onChange={newValue => SettingsStore.setAddonSetting(addonId, settingId, newValue)}
440441
/>
441-
{setting.type !== 'long_string' && (
442-
<ResetButton
443-
addonId={addonId}
444-
settingId={settingId}
445-
forTextInput
446-
/>
447-
)}
442+
{setting.type !== 'long_string' && setting.type !== 'long_password' && (
443+
<ResetButton
444+
addonId={addonId}
445+
settingId={settingId}
446+
forTextInput
447+
/>
448+
)}
448449
</React.Fragment>
449450
)}
450451
{setting.type === 'color' && (

0 commit comments

Comments
 (0)