mirror of
https://github.com/morten-olsen/parcel.git
synced 2026-02-08 01:36:24 +01:00
Improvments
This commit is contained in:
@@ -9,7 +9,7 @@ export interface FileType {
|
||||
reciever: string;
|
||||
status: 'encrypting' | 'failed' | 'encrypted';
|
||||
error?: any;
|
||||
link?: string;
|
||||
link?: Blob;
|
||||
}
|
||||
|
||||
interface EncryptionContextType {
|
||||
@@ -39,8 +39,8 @@ const encrypt = async (keys: string[], content: string) => {
|
||||
const blob = new Blob([data], {
|
||||
type: 'text/text',
|
||||
});
|
||||
const url = URL.createObjectURL(blob);
|
||||
return url;
|
||||
//const url = URL.createObjectURL(blob);
|
||||
return blob;
|
||||
};
|
||||
|
||||
const EncryptionProvider: React.FC = ({
|
||||
|
||||
@@ -33,6 +33,10 @@ const GithubContext = createContext<GithubContextType>({
|
||||
state: 'failed',
|
||||
});
|
||||
|
||||
const headers = {
|
||||
authorization: "token 22924bb3da8465e7e8575740f2fc0a4971c908db",
|
||||
};
|
||||
|
||||
const GithubProvider: React.FC<Props> = ({
|
||||
username,
|
||||
children,
|
||||
@@ -45,8 +49,8 @@ const GithubProvider: React.FC<Props> = ({
|
||||
useEffect(() => {
|
||||
const run = async () => {
|
||||
try {
|
||||
const keysRes = await fetch(`https://api.github.com/users/${username}/gpg_keys`);
|
||||
const userRes = await fetch(`https://api.github.com/users/${username}`);
|
||||
const keysRes = await fetch(`https://api.github.com/users/${username}/gpg_keys`, { headers });
|
||||
const userRes = await fetch(`https://api.github.com/users/${username}`, { headers });
|
||||
const keys = await keysRes.json();
|
||||
const user = await userRes.json();
|
||||
setState('ready');
|
||||
|
||||
Reference in New Issue
Block a user