Mobile app change theme (#2321)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2022-10-25 13:03:02 +06:00 committed by GitHub
parent 5568eeba3c
commit 47f577a0aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@
import view from '@hcengineering/view'
import { ActionContext, ActionHandler } from '@hcengineering/view-resources'
import type { Application, NavigatorModel, SpecialNavModel, ViewConfiguration } from '@hcengineering/workbench'
import { onDestroy, onMount, tick } from 'svelte'
import { getContext, onDestroy, onMount, tick } from 'svelte'
import { doNavigate } from '../utils'
import workbench from '../plugin'
import AccountPopup from './AccountPopup.svelte'
@ -138,6 +138,9 @@
onDestroy(
location.subscribe(async (loc) => {
if (window.nsWebViewBridge !== undefined) {
window.nsWebViewBridge.emit('navigate', JSON.stringify(loc))
}
closeTooltip()
closePopup()
@ -409,6 +412,9 @@
location.fragment = undefined
location.query = undefined
navigate(location)
} else if (data.action === 'theme') {
const { setTheme } = getContext('theme') as any
setTheme(`theme-${data.value}`)
}
} catch (err) {
console.log(`Couldn't recognize event ${JSON.stringify(event)}`)