feat: import models

This commit is contained in:
Timothy J. Baek 2024-05-25 00:36:08 -07:00
parent ea69087697
commit fad07d2049
3 changed files with 7 additions and 6 deletions

View File

@ -259,9 +259,11 @@
console.log(savedModels); console.log(savedModels);
for (const model of savedModels) { for (const model of savedModels) {
await addNewModel(localStorage.token, model).catch((error) => { if (model?.info ?? false) {
return null; await addNewModel(localStorage.token, model.info).catch((error) => {
}); return null;
});
}
} }
await models.set(await getModels(localStorage.token)); await models.set(await getModels(localStorage.token));

View File

@ -163,12 +163,12 @@
}); });
</script> </script>
<div class=" hidden lg:flex fixed bottom-0 right-0 px-3 py-3 z-10"> <div class=" hidden lg:flex fixed bottom-0 right-0 px-2 py-2 z-10">
<Tooltip content={$i18n.t('Help')} placement="left"> <Tooltip content={$i18n.t('Help')} placement="left">
<button <button
id="show-shortcuts-button" id="show-shortcuts-button"
bind:this={showShortcutsButtonElement} bind:this={showShortcutsButtonElement}
class="text-gray-600 dark:text-gray-300 bg-gray-300/20 w-6 h-6 flex items-center justify-center text-xs rounded-full" class="text-gray-600 dark:text-gray-300 bg-gray-300/20 size-5 flex items-center justify-center text-[0.7rem] rounded-full"
on:click={() => { on:click={() => {
showShortcuts = !showShortcuts; showShortcuts = !showShortcuts;
}} }}

View File

@ -73,7 +73,6 @@
} }
if (info) { if (info) {
// TODO: if profile image url === null, set it to default image '/favicon.png'
const res = await addNewModel(localStorage.token, { const res = await addNewModel(localStorage.token, {
...info, ...info,
meta: { meta: {