Skip to content

Commit

Permalink
Merge pull request #203 from cachho/style/Popup
Browse files Browse the repository at this point in the history
style: sort agents alphabetically
  • Loading branch information
cachho authored Jan 3, 2025
2 parents 8acc073 + 019e909 commit 85deaec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { defaultSettings, settingNames } from '../models/Settings';
const Popup = () => {
const [settings, setSettings] = useState<Settings>(defaultSettings);
const storage = getStorage();
const sortedAgents = agents.slice().sort((a, b) => a.localeCompare(b));

function setValues(updatedSettings: Partial<Settings>) {
setSettings((prevSettings) => ({
Expand Down Expand Up @@ -109,7 +110,7 @@ const Popup = () => {
</p>
<h2 style={{ textAlign: 'center' }}>My Shopping Agent</h2>
<select onChange={handleChangeMyAgent} value={settings.myAgent}>
{agentsWithRaw.map((agent) => (
{[...sortedAgents, 'raw'].map((agent) => (
<option value={agent} key={`my-agent-select-${agent}`}>
{agent}
</option>
Expand Down Expand Up @@ -230,7 +231,7 @@ const Popup = () => {
{settings.showToolbar ? (
<>
<h4>toolbar includes:</h4>
{agents.map((agent) => {
{sortedAgents.map((agent) => {
const checked = settings.agentsInToolbar.includes(agent);

function swap() {
Expand Down

0 comments on commit 85deaec

Please sign in to comment.