node build fixed
This commit is contained in:
26
seanime-2.9.10/internal/plugin/plugin_app.go
Normal file
26
seanime-2.9.10/internal/plugin/plugin_app.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"seanime/internal/constants"
|
||||
"seanime/internal/events"
|
||||
"seanime/internal/extension"
|
||||
|
||||
"github.com/dop251/goja"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
func (a *AppContextImpl) BindApp(vm *goja.Runtime, logger *zerolog.Logger, ext *extension.Extension) {
|
||||
appObj := vm.NewObject()
|
||||
appObj.Set("getVersion", constants.Version)
|
||||
appObj.Set("getVersionName", constants.VersionName)
|
||||
|
||||
appObj.Set("invalidateClientQuery", func(keys []string) {
|
||||
wsEventManager, ok := a.wsEventManager.Get()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
wsEventManager.SendEvent(events.InvalidateQueries, keys)
|
||||
})
|
||||
|
||||
_ = vm.Set("$app", appObj)
|
||||
}
|
||||
Reference in New Issue
Block a user