-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 🔥 Remove unused code and dependencies.
- Loading branch information
1 parent
185eae2
commit 467832d
Showing
8 changed files
with
109 additions
and
174 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
pub mod error; | ||
pub mod keygen; | ||
mod secret_file; | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,17 @@ | ||
<script setup lang="ts"> | ||
import { onMounted, onUnmounted, ref } from "vue"; | ||
import { ref } from "vue"; | ||
import FileSelector from "@/components/FileSelector.vue"; | ||
import { TauriEvent, listen, type UnlistenFn } from "@tauri-apps/api/event"; | ||
const onUpdate = (e: Event) => { | ||
console.log((e.target as HTMLInputElement).value); | ||
}; | ||
const files = ref<string[]>([]); | ||
const hover = ref(false); | ||
const onFilesSelected = (files_selected: string[]) => { | ||
console.log(files_selected); | ||
files.value = files_selected; | ||
}; | ||
let unlistenFileDrop: UnlistenFn | undefined; | ||
let unlistenFileDropHover: UnlistenFn | undefined; | ||
let unlistenFileDropCanceled: UnlistenFn | undefined; | ||
let unlistenBlur: UnlistenFn | undefined; | ||
onMounted(async () => { | ||
unlistenFileDrop = await listen<string[]>( | ||
TauriEvent.WINDOW_FILE_DROP, | ||
(e) => { | ||
files.value = e.payload; | ||
hover.value = false; | ||
}, | ||
); | ||
unlistenFileDropHover = await listen<string[]>( | ||
TauriEvent.WINDOW_FILE_DROP_HOVER, | ||
(e) => { | ||
console.log(e.payload); | ||
hover.value = true; | ||
}, | ||
); | ||
unlistenFileDropCanceled = await listen<void>( | ||
TauriEvent.WINDOW_FILE_DROP_CANCELLED, | ||
() => { | ||
hover.value = false; | ||
}, | ||
); | ||
unlistenBlur = await listen<void>(TauriEvent.WINDOW_BLUR, () => { | ||
console.log("Blur"); | ||
hover.value = false; | ||
}); | ||
}); | ||
onUnmounted(() => { | ||
[ | ||
unlistenFileDrop, | ||
unlistenFileDropHover, | ||
unlistenFileDropCanceled, | ||
unlistenBlur, | ||
].forEach((unlisten) => { | ||
if (unlisten) { | ||
unlisten(); | ||
} | ||
}); | ||
}); | ||
const file = ref<string>(); | ||
</script> | ||
|
||
<template> | ||
<FileSelector @file-selected="onFilesSelected" /> | ||
<ul> | ||
<li v-for="file in files" :key="file"> | ||
{{ file }} | ||
</li> | ||
</ul> | ||
<div v-if="hover" class="red">Hovering</div> | ||
<FileSelector v-model="file" /> | ||
<div v-if="file"> | ||
{{ file }} | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.red { | ||
color: red; | ||
} | ||
</style> |
Oops, something went wrong.