mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +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 { 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 { NotFound, RenderError, Crash, Settings, Navigation } from "components"
|
||||
@ -186,16 +186,7 @@ class App {
|
||||
return {
|
||||
// TODO: Open with popup controller instead drawer controller
|
||||
openNavigationMenu: () => window.app.DrawerController.open("navigation", Navigation),
|
||||
openSettings: (goTo) => {
|
||||
window.app.DrawerController.open("settings", Settings, {
|
||||
props: {
|
||||
width: "fit-content",
|
||||
},
|
||||
componentProps: {
|
||||
goTo,
|
||||
}
|
||||
})
|
||||
},
|
||||
openSettings: App.publicMethods.openSettings,
|
||||
goMain: () => {
|
||||
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()
|
||||
userController = new User()
|
||||
state = {
|
||||
@ -276,6 +280,13 @@ class App {
|
||||
window.app.hideStatusBar()
|
||||
}
|
||||
|
||||
window.app.ShortcutsController.register({
|
||||
key: ",",
|
||||
meta: true,
|
||||
}, (...args) => {
|
||||
App.publicMethods.openSettings(...args)
|
||||
})
|
||||
|
||||
this.eventBus.emit("render_initialization")
|
||||
|
||||
await this.initialization()
|
||||
@ -394,6 +405,7 @@ class App {
|
||||
|
||||
export default CreateEviteApp(App, {
|
||||
extensions: [
|
||||
Shortcuts,
|
||||
SettingsController,
|
||||
i18n.extension,
|
||||
Sound.extension,
|
||||
|
Loading…
x
Reference in New Issue
Block a user