Add route hook action

This commit is contained in:
Chocobozzz 2019-07-26 09:42:52 +02:00
parent 1fd372ecbc
commit 73a0294104
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 16 additions and 1 deletions

View File

@ -46,6 +46,13 @@ function register ({ registerHook, peertubeHelpers }) {
handler: result => addSymbolToVideoNameResult(result, ':D')
})
// Router hooks
registerHook({
target: 'action:router.navigation-end',
handler: params => console.log('New URL! %s.', params.path)
})
// Fake hook
registerHook({

View File

@ -15,9 +15,17 @@ async function register ({ registerHook, registerSetting, settingsManager, stora
name: 'admin-name',
label: 'Admin name',
type: 'input',
private: true,
default: defaultAdmin
})
registerSetting({
name: 'user-name',
label: 'User name',
type: 'input',
private: false
})
const value = await storageManager.getData('toto')
console.log(value)

View File

@ -1,6 +1,6 @@
{
"name": "peertube-plugin-hello-world",
"version": "0.0.11",
"version": "0.0.12",
"description": "Hello world PeerTube plugin example",
"engine": {
"peertube": ">=1.3.0"