Code format
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import { type Food, FoodService } from '$lib/database/food'
|
import { type Food, FoodService } from '$lib/database/food'
|
||||||
import type { Writable } from 'svelte/store'
|
|
||||||
|
|
||||||
let food: Food[] = []
|
let food: Food[] = []
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
@@ -12,7 +12,8 @@ const FoodService = {
|
|||||||
async GetAll() {
|
async GetAll() {
|
||||||
return await db.select<Food[]>('SELECT rowid, food, amount, per100, energy FROM food ORDER BY date DESC')
|
return await db.select<Food[]>('SELECT rowid, food, amount, per100, energy FROM food ORDER BY date DESC')
|
||||||
},
|
},
|
||||||
async SetAll(data: Food[]) {}
|
async SetAll(data: Food[]) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {FoodService}
|
export { FoodService }
|
||||||
|
@@ -8,22 +8,20 @@ declare global {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Function avoids 'window not defined' in SSR
|
// Function avoids 'window not defined' in SSR
|
||||||
const invoke = () => window.__TAURI_INVOKE__;
|
const invoke = () => window.__TAURI_INVOKE__
|
||||||
|
|
||||||
export function helloTauri() {
|
export function helloTauri() {
|
||||||
return invoke()<string>("hello_tauri")
|
return invoke()<string>('hello_tauri')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hash256sum(hashInput: string) {
|
export function hash256sum(hashInput: string) {
|
||||||
return invoke()<string>("hash256sum", { hashInput })
|
return invoke()<string>('hash256sum', { hashInput })
|
||||||
}
|
}
|
||||||
|
|
||||||
export function storeSetKey(key: string, value: string) {
|
export function storeSetKey(key: string, value: string) {
|
||||||
return invoke()<null>("store_set_key", { key,value })
|
return invoke()<null>('store_set_key', { key, value })
|
||||||
}
|
}
|
||||||
|
|
||||||
export function storeReadKey(key: string) {
|
export function storeReadKey(key: string) {
|
||||||
return invoke()<string | null>("store_read_key", { key })
|
return invoke()<string | null>('store_read_key', { key })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3,11 +3,11 @@
|
|||||||
<h2 class="flex items-center text-3xl [&_img]:h-12">
|
<h2 class="flex items-center text-3xl [&_img]:h-12">
|
||||||
This is a  
|
This is a  
|
||||||
<span>
|
<span>
|
||||||
<img src="/svelte_logo.svg" alt="svelte logo" />
|
<img alt="svelte logo" src="/svelte_logo.svg" />
|
||||||
</span>
|
</span>
|
||||||
 - 
|
 - 
|
||||||
<span>
|
<span>
|
||||||
<img src="/tauri_logo.svg" alt="svelte logo" />
|
<img alt="svelte logo" src="/tauri_logo.svg" />
|
||||||
</span>
|
</span>
|
||||||
  Template
|
  Template
|
||||||
</h2>
|
</h2>
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getTauriVersion, getVersion, getName } from '@tauri-apps/api/app'
|
import { getName, getTauriVersion, getVersion } from '@tauri-apps/api/app'
|
||||||
|
|
||||||
type Versions = {
|
type Versions = {
|
||||||
tauri: string
|
tauri: string
|
||||||
app: string
|
app: string
|
||||||
|
Reference in New Issue
Block a user