mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
use Shortcuts
extension
This commit is contained in:
parent
fea6a88a1d
commit
d77145e1e3
@ -51,7 +51,7 @@ import { StatusBar, Style } from "@capacitor/status-bar"
|
|||||||
import { Translation } from "react-i18next"
|
import { Translation } from "react-i18next"
|
||||||
|
|
||||||
import { Session, User } from "models"
|
import { Session, User } from "models"
|
||||||
import { API, SettingsController, Render, Splash, Theme, Sound, Notifications, i18n, Debug } from "extensions"
|
import { API, SettingsController, Render, Splash, Theme, Sound, Notifications, i18n, Debug, Shortcuts } from "extensions"
|
||||||
import config from "config"
|
import config from "config"
|
||||||
|
|
||||||
import { NotFound, RenderError, Crash, Settings, Navigation } from "components"
|
import { NotFound, RenderError, Crash, Settings, Navigation } from "components"
|
||||||
@ -186,16 +186,7 @@ class App {
|
|||||||
return {
|
return {
|
||||||
// TODO: Open with popup controller instead drawer controller
|
// TODO: Open with popup controller instead drawer controller
|
||||||
openNavigationMenu: () => window.app.DrawerController.open("navigation", Navigation),
|
openNavigationMenu: () => window.app.DrawerController.open("navigation", Navigation),
|
||||||
openSettings: (goTo) => {
|
openSettings: App.publicMethods.openSettings,
|
||||||
window.app.DrawerController.open("settings", Settings, {
|
|
||||||
props: {
|
|
||||||
width: "fit-content",
|
|
||||||
},
|
|
||||||
componentProps: {
|
|
||||||
goTo,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goMain: () => {
|
goMain: () => {
|
||||||
return window.app.setLocation(config.app.mainPath)
|
return window.app.setLocation(config.app.mainPath)
|
||||||
},
|
},
|
||||||
@ -255,6 +246,19 @@ class App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static publicMethods = {
|
||||||
|
"openSettings": (goTo) => {
|
||||||
|
window.app.DrawerController.open("settings", Settings, {
|
||||||
|
props: {
|
||||||
|
width: "fit-content",
|
||||||
|
},
|
||||||
|
componentProps: {
|
||||||
|
goTo,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sessionController = new Session()
|
sessionController = new Session()
|
||||||
userController = new User()
|
userController = new User()
|
||||||
state = {
|
state = {
|
||||||
@ -276,6 +280,13 @@ class App {
|
|||||||
window.app.hideStatusBar()
|
window.app.hideStatusBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.app.ShortcutsController.register({
|
||||||
|
key: ",",
|
||||||
|
meta: true,
|
||||||
|
}, (...args) => {
|
||||||
|
App.publicMethods.openSettings(...args)
|
||||||
|
})
|
||||||
|
|
||||||
this.eventBus.emit("render_initialization")
|
this.eventBus.emit("render_initialization")
|
||||||
|
|
||||||
await this.initialization()
|
await this.initialization()
|
||||||
@ -394,6 +405,7 @@ class App {
|
|||||||
|
|
||||||
export default CreateEviteApp(App, {
|
export default CreateEviteApp(App, {
|
||||||
extensions: [
|
extensions: [
|
||||||
|
Shortcuts,
|
||||||
SettingsController,
|
SettingsController,
|
||||||
i18n.extension,
|
i18n.extension,
|
||||||
Sound.extension,
|
Sound.extension,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user