fix warnings

This commit is contained in:
Nikita Galaiko 2023-05-10 14:31:46 +02:00
parent 1d68fb946a
commit c44f87ca90
4 changed files with 3 additions and 70 deletions

View File

@ -5,7 +5,6 @@
import { compareDesc, formatDistanceToNow } from 'date-fns';
import { IconBookmark, IconFolder, IconLoading } from './icons';
import { toasts, api } from '$lib';
import { onMount } from 'svelte';
type Unpromisify<T> = T extends Promise<infer U> ? U : T;

View File

@ -13,19 +13,6 @@
// const chainUrl = 'http://127.0.0.1:8000';
const chainUrl = 'https://zpuszumgur.us-east-1.awsapprunner.com';
async function createSummary(text: string) {
const response = await fetch(`${chainUrl}/summaries`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ text: text })
});
const data = await response.json();
return data;
}
async function createChat() {
const response = await fetch(`${chainUrl}/chats`, {
method: 'POST',
@ -61,19 +48,6 @@
return sequence;
}
async function addToSummary(id: string, newText: string) {
const response = await fetch(`${chainUrl}/summaries`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ id, text: newText })
});
const sequence = await response.json();
return sequence;
}
async function getSummary(id: string) {
const response = await fetch(`${chainUrl}/summaries/${id}`, {
method: 'GET'
@ -84,16 +58,13 @@
}
let summaryId = '';
let input = '';
let sequence = 0;
let processedSeq = 0;
let summary = '';
$: if (summaryId && processedSeq != sequence) {
debounce(() => {
console.log('polling summary');
getSummary(summaryId).then((data) => {
summary = data.text;
processedSeq = data.sequence;
});
}, 1000)();
@ -362,45 +333,6 @@
}
}
.breathing-orb {
/* Styling */
position: absolute;
width: 20px;
height: 20px;
left: 16px;
top: 6px;
animation: breathingOrb 4s ease-in-out infinite;
background: rgba(154, 115, 221, 1);
filter: blur(6px);
border-radius: 32px;
/*
* Make the initial position to be the center of the circle you want this
* object follow.
*/
position: absolute;
left: 10px;
top: 10px;
}
/*
* Set up the keyframes to actually describe the begining and end states of
* the animation. The browser will interpolate all the frames between these
* points. Again, remember your vendor-specific prefixes for now!
*/
@keyframes breathingOrb {
0% {
opacity: 0.8;
}
50% {
opacity: 0.4;
}
100% {
opacity: 0.8;
}
}
.loading-orbit {
/* Styling */
position: absolute;

View File

@ -8,7 +8,7 @@
import { error, success } from '$lib/toasts';
import { fly } from 'svelte/transition';
import { Dialog } from '$lib/components';
import { log, api } from '$lib';
import { log } from '$lib';
import IconChevronUp from '$lib/components/icons/IconChevronUp.svelte';
import IconChevronDown from '$lib/components/icons/IconChevronDown.svelte';
import { onMount } from 'svelte';

View File

@ -135,6 +135,8 @@
/* this is trick to make webkit use hardware acceleration */
figure * {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-perspective: 1000;
perspective: 1000;
}
</style>