From 78235f0e3d0363f0d0a96e852513b53075309a7c Mon Sep 17 00:00:00 2001
From: PandaDEV <70103896+0PandaDEV@users.noreply.github.com>
Date: Mon, 2 Sep 2024 17:53:53 +1000
Subject: [PATCH] fixed types and icons
---
components/Icons/Code.vue | 11 -----------
components/Icons/File.vue | 11 -----------
components/Icons/Image.vue | 11 -----------
components/Icons/Text.vue | 11 -----------
pages/index.vue | 23 ++++++++++++++---------
public/icons/Code.svg | 10 ++++++++++
public/icons/File.svg | 10 ++++++++++
public/icons/Image.svg | 10 ++++++++++
public/icons/Text.svg | 10 ++++++++++
9 files changed, 54 insertions(+), 53 deletions(-)
delete mode 100644 components/Icons/Code.vue
delete mode 100644 components/Icons/File.vue
delete mode 100644 components/Icons/Image.vue
delete mode 100644 components/Icons/Text.vue
create mode 100644 public/icons/Code.svg
create mode 100644 public/icons/File.svg
create mode 100644 public/icons/Image.svg
create mode 100644 public/icons/Text.svg
diff --git a/components/Icons/Code.vue b/components/Icons/Code.vue
deleted file mode 100644
index b521a9f..0000000
--- a/components/Icons/Code.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/components/Icons/File.vue b/components/Icons/File.vue
deleted file mode 100644
index 97136c0..0000000
--- a/components/Icons/File.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/components/Icons/Image.vue b/components/Icons/Image.vue
deleted file mode 100644
index 42eca9f..0000000
--- a/components/Icons/Image.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/components/Icons/Text.vue b/components/Icons/Text.vue
deleted file mode 100644
index a35d18e..0000000
--- a/components/Icons/Text.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/pages/index.vue b/pages/index.vue
index 76cc03e..ef412a1 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -35,13 +35,13 @@
-
+
-
-
-
+
+
+
Image ({{ item.dimensions || 'Loading...' }})
{{ truncateContent(item.content) }}
@@ -366,8 +366,10 @@ const loadHistoryChunk = async (): Promise => {
const handleScroll = (): void => {
if (!resultsContainer.value) return;
- const { viewport } = resultsContainer.value?.osInstance().elements() ?? {};
- const { scrollTop = 0, scrollHeight = 0, clientHeight = 0 } = viewport ?? {};
+ const viewport = resultsContainer.value?.osInstance()?.elements().viewport;
+ const scrollTop = viewport?.scrollTop ?? 0;
+ const scrollHeight = viewport?.scrollHeight ?? 0;
+ const clientHeight = viewport?.clientHeight ?? 0;
if (scrollHeight - scrollTop - clientHeight < 100) {
loadHistoryChunk();
@@ -418,6 +420,11 @@ const scrollToSelectedItem = (): void => {
});
};
+const onImageError = (): void => {
+ imageLoadError.value = true;
+ imageLoading.value = false;
+};
+
watch([selectedGroupIndex, selectedItemIndex], scrollToSelectedItem);
watch(searchQuery, () => {
@@ -428,9 +435,7 @@ onMounted(async () => {
db.value = await Database.load('sqlite:data.db');
await loadHistoryChunk();
- if (resultsContainer.value) {
- resultsContainer.value.osInstance().elements().viewport.addEventListener('scroll', handleScroll);
- }
+ resultsContainer.value?.osInstance()?.elements()?.viewport?.addEventListener('scroll', handleScroll);
await listen('tauri://focus', async () => {
history.value = [];
diff --git a/public/icons/Code.svg b/public/icons/Code.svg
new file mode 100644
index 0000000..b5c1a42
--- /dev/null
+++ b/public/icons/Code.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/public/icons/File.svg b/public/icons/File.svg
new file mode 100644
index 0000000..a0b4fdd
--- /dev/null
+++ b/public/icons/File.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/public/icons/Image.svg b/public/icons/Image.svg
new file mode 100644
index 0000000..c177239
--- /dev/null
+++ b/public/icons/Image.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/public/icons/Text.svg b/public/icons/Text.svg
new file mode 100644
index 0000000..83f8532
--- /dev/null
+++ b/public/icons/Text.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file