Skip to content

Commit

Permalink
v0.0.9 - A lot of fixes
Browse files Browse the repository at this point in the history
✨ Allow exporting local SSH and GPG
πŸ—οΈ Separate the profile update functionality from the visual notifications.
πŸ—ƒοΈ Fix SSH pair storage
πŸ“ˆ Analytics
🩹 Fixed name and email input width issue
  • Loading branch information
fax1ty committed Jul 20, 2023
1 parent 61bc3ed commit 59c10cc
Show file tree
Hide file tree
Showing 46 changed files with 1,721 additions and 338 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dogit",
"private": true,
"version": "0.0.8",
"version": "0.0.9",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -12,11 +12,11 @@
},
"dependencies": {
"@floating-ui/react": "^0.24.3",
"@fontsource/roboto": "^5.0.5",
"@phosphor-icons/react": "^2.0.10",
"@tauri-apps/api": "^1.4.0",
"axios": "^1.4.0",
"clsx": "^1.2.1",
"firebase": "^10.0.0",
"just-throttle": "^4.2.0",
"keen-slider": "^6.8.5",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dogit"
version = "0.0.8"
version = "0.0.9"
description = "Dogit"
authors = ["Artemiy Davydov"]
license = "MIT"
Expand All @@ -14,6 +14,7 @@ tauri-build = { version = "1.4", features = [] }

[dependencies]
tauri = { version = "1.4", features = [
"clipboard-write-text",
"updater",
"process-relaunch",
"window-set-focus",
Expand Down
6 changes: 5 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"package": {
"productName": "dogit",
"version": "0.0.8"
"version": "0.0.9"
},
"tauri": {
"allowlist": {
Expand Down Expand Up @@ -56,6 +56,10 @@
"process": {
"all": false,
"relaunch": true
},
"clipboard": {
"all": false,
"writeText": true
}
},
"bundle": {
Expand Down
10 changes: 7 additions & 3 deletions src/api/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import useSWR from "swr";

import { LocalProfile, usePersistStore } from "../store/persist";
import { executeBase } from "./execute";
import { addSSHKeyPair, startSSHAgent } from "./ssh";

const execute = (args?: string | string[]) => executeBase("git", args);

Expand Down Expand Up @@ -67,14 +68,17 @@ export const useLocalProfile = () => {
await setSigningKey(profile.gpg);
await setAutosign(true);
} else {
//! code 5
// await removeSigningKey();
await setAutosign(false);
}

if (profile.ssh) {
await addSSHKeyPair(profile.ssh.private);
await startSSHAgent();
}

finishSync("local");
return profile;
},
{ refreshWhenHidden: true, refreshInterval: 5 * 60 * 1000 }
{ revalidateOnFocus: false, revalidateOnMount: false }
);
};
16 changes: 10 additions & 6 deletions src/api/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useSWR from "swr";

import { GithubProfile, GithubUser, usePersistStore } from "../store/persist";
import { setAutosign, setEmail, setName, setSigningKey } from "./git";
import { addSSHKeyPair, startSSHAgent } from "./ssh";

const fetcher = axios.create({
baseURL: "https://api.github.com",
Expand Down Expand Up @@ -61,15 +62,18 @@ export const useGithubProfile = (
await setSigningKey(profile.gpg);
await setAutosign(true);
} else {
//! code 5
// await removeSigningKey();
await setAutosign(false);
}

if (profile.ssh) {
await addSSHKeyPair(profile.ssh.private);
await startSSHAgent();
}

finishSync(id);
return data;
},
{ refreshWhenHidden: true, refreshInterval: 5 * 60 * 1000 }
{ revalidateOnFocus: false, revalidateOnMount: false }
);
};

Expand Down Expand Up @@ -136,7 +140,7 @@ export const removeGPGKey = (
accessToken: GithubProfile["user"]["accessToken"],
id: GithubGPGKeyResponse["id"]
) =>
axios.delete(`/user/gpg_keys/${id}`, {
fetcher.delete(`/user/gpg_keys/${id}`, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
Expand Down Expand Up @@ -179,9 +183,9 @@ export const listSSHKeys = async (

export const removeSSHKey = async (
accessToken: GithubProfile["user"]["accessToken"],
idx: GitHubSSHKeyResponse["id"]
id: GitHubSSHKeyResponse["id"]
) =>
fetcher.delete<GitHubSSHKeyResponse[]>(`/user/keys/${idx}`, {
fetcher.delete(`/user/keys/${id}`, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
Expand Down
2 changes: 2 additions & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import { Focuser } from "./managers/focuser";
import { NoContext } from "./managers/no-context";
import { Notifications } from "./managers/notifications";
import { Resizer } from "./managers/resizer";
import { Syncronizer } from "./managers/syncronizer";

export const App = () => {
return (
<Talkr languages={{ ru, en }} defaultLanguage="en" detectBrowserLanguage>
<Syncronizer />
<DeepLinks />
<Resizer />
<NoContext />
Expand Down
8 changes: 6 additions & 2 deletions src/components/buttons/default/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import { SpinnerCircular } from "spinners-react";

import classes from "./styles.module.scss";

type Props = {
export type ButtonProps = {
loading?: boolean;
} & ButtonHTMLAttributes<HTMLButtonElement>;

export const Button = ({ loading = false, children, ...props }: Props) => {
export const Button = ({
loading = false,
children,
...props
}: ButtonProps) => {
return (
<button {...props} className={clsx(props.className, classes.button)}>
{children}
Expand Down
4 changes: 2 additions & 2 deletions src/components/typography/styles.module.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.bold {
font-size: 14.5px;
font-family: Roboto, sans-serif;
font-family: Roboto;
font-weight: 700;
line-height: 140%;
}

.regular {
font-weight: 400;
font-size: 12px;
font-family: Roboto, sans-serif;
font-family: Roboto;
line-height: 140%;
}
9 changes: 9 additions & 0 deletions src/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"apiKey": "AIzaSyAj7i-AitSqEUSFxwbMRE4911ASWXtAK6Y",
"authDomain": "dogit-863e6.firebaseapp.com",
"projectId": "dogit-863e6",
"storageBucket": "dogit-863e6.appspot.com",
"messagingSenderId": "514141230363",
"appId": "1:514141230363:web:ece9c0999afa66f827afbe",
"measurementId": "G-6FMCZS4T29"
}
Loading

0 comments on commit 59c10cc

Please sign in to comment.