remove unnecessary casts
This commit is contained in:
parent
428df339c4
commit
a09caf52d8
|
@ -19,10 +19,7 @@ export class ThemeStore extends BudiStore<ThemeState> {
|
|||
|
||||
syncAppTheme = (app: App) => {
|
||||
this.update(state => {
|
||||
const theme = ensureValidTheme(
|
||||
app.theme as Theme | undefined,
|
||||
DefaultAppTheme
|
||||
) as Theme
|
||||
const theme = ensureValidTheme(app.theme, DefaultAppTheme)
|
||||
return {
|
||||
...state,
|
||||
theme,
|
||||
|
@ -35,10 +32,7 @@ export class ThemeStore extends BudiStore<ThemeState> {
|
|||
const app = await API.saveAppMetadata(appId, { theme })
|
||||
this.update(state => ({
|
||||
...state,
|
||||
theme: ensureValidTheme(
|
||||
app.theme as Theme | undefined,
|
||||
DefaultAppTheme
|
||||
) as Theme,
|
||||
theme: ensureValidTheme(app.theme, DefaultAppTheme),
|
||||
}))
|
||||
}
|
||||
|
||||
|
@ -55,10 +49,7 @@ export class ThemeStore extends BudiStore<ThemeState> {
|
|||
const { theme, customTheme } = metadata
|
||||
this.update(state => ({
|
||||
...state,
|
||||
theme: ensureValidTheme(
|
||||
theme as Theme | undefined,
|
||||
DefaultAppTheme
|
||||
) as Theme,
|
||||
theme: ensureValidTheme(theme, DefaultAppTheme),
|
||||
customTheme: customTheme || {},
|
||||
}))
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { User, Document, Plugin, Snippet } from "../"
|
||||
import { User, Document, Plugin, Snippet, Theme } from "../"
|
||||
import { SocketSession } from "../../sdk"
|
||||
|
||||
export type AppMetadataErrors = { [key: string]: string[] }
|
||||
|
@ -14,7 +14,7 @@ export interface App extends Document {
|
|||
instance: AppInstance
|
||||
tenantId: string
|
||||
status: string
|
||||
theme?: string
|
||||
theme?: Theme
|
||||
customTheme?: AppCustomTheme
|
||||
revertableVersion?: string
|
||||
lockedBy?: User
|
||||
|
|
Loading…
Reference in New Issue