Skip to content

Commit

Permalink
Merge pull request #9 from dre-bk201/dev
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
dre-bk201 authored Oct 22, 2023
2 parents 32227b9 + e94dab1 commit 588a8c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "SmartOrganizer",
"private": true,
"version": "0.9.1",
"version": "0.9.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "SmartOrganizer",
"version": "0.9.1"
"version": "0.9.2"
},
"tauri": {
"updater": {
Expand Down
30 changes: 10 additions & 20 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
import { reactive, nextTick, computed, provide, onMounted, ref } from "vue";
import { invoke } from "@tauri-apps/api/tauri";
import { listen } from "@tauri-apps/api/event";
import { platform } from "@tauri-apps/api/os";
import { FocusOutsideEvent, PointerDownOutsideEvent } from "node_modules/radix-vue/dist/DismissableLayer";
import {
Expand Down Expand Up @@ -91,7 +92,11 @@ provide("triggerCleaning", triggerClean);
onMounted(() => {
(async () => {
let settings = await invoke("load_settings");
if (settings) settingStore.setState(settings);
if (settings) {
settingStore.setState(settings);
if (settingStore.theme === 'dark') document.documentElement.classList.add('dark');
else document.documentElement.classList.remove('dark');
}
let { logs, listeners }: { logs: ILog[], listeners: IListener[] } = await invoke("load_from_database");
Expand All @@ -103,41 +108,26 @@ onMounted(() => {
triggerClean.value = true;
});
// Starts listener filesystem service
await invoke("start_listener");
if (settingStore.theme === 'dark') document.documentElement.classList.add('dark');
else document.documentElement.classList.remove('dark');
// UPDATER
const unlisten = await onUpdaterEvent(({ error, status }) => {
// This will log all updater events, including status updates and errors.
console.log('Updater event', error, status)
})
try {
const { shouldUpdate, manifest } = await checkUpdate()
const { shouldUpdate } = await checkUpdate()
if (shouldUpdate) {
// You could show a dialog asking the user if they want to install the update here.
console.log(
`Installing update ${manifest?.version}, ${manifest?.date}, ${manifest?.body}`
)
// Install the update. This will also restart the app on Windows!
await installUpdate()
// On macOS and Linux you will need to restart the app manually.
// You could use this step to display another confirmation dialog.
await relaunch()
if (await platform() !== "win32") await relaunch()
}
} catch (error) {
console.error(error)
}
// you need to call unlisten if your handler goes out of scope, for example if the component is unmounted.
unlisten()
})();
Expand Down

0 comments on commit 588a8c4

Please sign in to comment.