Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: enhance configuration url handle #499

Merged
merged 1 commit into from
Nov 17, 2024
Merged
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
21 changes: 16 additions & 5 deletions src/renderer/components/SettingsSection/Developer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React, { FC, useCallback, useEffect, useState } from 'react';
import { useSetting } from 'renderer/rendererSettings';
import { Toggle } from 'renderer/components/Toggle';
import * as packageInfo from '../../../../package.json';
import { Button, ButtonType } from 'renderer/components/Button';
import { ipcRenderer } from 'electron';
import channels from 'common/channels';

const SettingsItem: FC<{ name: string }> = ({ name, children }) => (
<div className="flex flex-row items-center justify-between py-3.5">
Expand Down Expand Up @@ -45,12 +48,20 @@ export const DeveloperSettings: React.FC = () => {
onBlur={() => validateUrl()}
size={50}
/>
<input
className="ml-2"
type="button"
value="Reset to default"
<Button
type={ButtonType.Neutral}
className="ml-2 h-fit min-h-10 text-lg"
onClick={() => ipcRenderer.send(channels.window.reload)}
>
Reload Installer
</Button>
<Button
type={ButtonType.Neutral}
className="ml-2 h-fit min-h-10 text-lg"
onClick={() => setConfigDownloadUrl(packageInfo.configUrls.production)}
/>
>
Reset to default
</Button>
</div>
</SettingsItem>
<SettingsItem name="Force Use Local Configuration">
Expand Down
Loading