Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
HuakunShen committed Nov 3, 2024
1 parent e9bdb9d commit f418733
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions apps/desktop/src/lib/context/appConfig.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* This is app state context.
* This is app state context.
* It's designed to allow all components to access a shared state.
* With context, we can avoid prop drilling, and avoid using stores which makes components hard to encapsulate.
*/
import type { AppConfig } from '@/types/appConfig';
import { getContext, setContext } from 'svelte'
import type { Writable } from 'svelte/store';
import type { AppConfig } from "@/types/appConfig"
import { getContext, setContext } from "svelte"
import type { Writable } from "svelte/store"

export const APP_CONFIG_CONTEXT_KEY = Symbol('appConfig')
export const APP_CONFIG_CONTEXT_KEY = Symbol("appConfig")

export function getAppConfigContext(): Writable<AppConfig> {
return getContext(APP_CONFIG_CONTEXT_KEY)
Expand Down
8 changes: 4 additions & 4 deletions apps/desktop/src/lib/context/appState.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { AppState } from '@/types/appState';
import { getContext, setContext } from 'svelte'
import type { Writable } from 'svelte/store';
import type { AppState } from "@/types/appState"
import { getContext, setContext } from "svelte"
import type { Writable } from "svelte/store"

export const APP_STATE_CONTEXT_KEY = Symbol('appState')
export const APP_STATE_CONTEXT_KEY = Symbol("appState")

export function getAppStateContext(): Writable<AppState> {
return getContext(APP_STATE_CONTEXT_KEY)
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/lib/context/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './appConfig'
export * from "./appConfig"
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/utils/key.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { goto } from "$app/navigation"
import { appState } from "@/stores"
import { goto } from "$app/navigation"
import { goBack, goHome } from "./route"

export function goHomeOnEscape(e: KeyboardEvent) {
Expand All @@ -22,4 +22,4 @@ export function goBackOnEscapeClearSearchTerm(e: KeyboardEvent) {
goBack()
}
}
}
}
2 changes: 1 addition & 1 deletion packages/ui/src/components/main/BuiltinCmds.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { IconEnum } from "@kksh/api/models"
import { Command } from "@kksh/svelte5"
import type { BuiltinCmd } from "@kksh/types"
import { DraggableCommandGroup } from "@kksh/ui/custom"
import { IconMultiplexer } from "@kksh/ui"
import { DraggableCommandGroup } from "@kksh/ui/custom"
const { builtinCmds }: { builtinCmds: BuiltinCmd[] } = $props()
</script>
Expand Down

0 comments on commit f418733

Please sign in to comment.