Skip to content
Snippets Groups Projects
Commit d6cf863d authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

#195 - Fetch current page on initial connection

parent b029aeba
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ const Project = require("./project"); ...@@ -8,6 +8,7 @@ const Project = require("./project");
const PadNameUpdate = require("./receive/pad_name_update"); const PadNameUpdate = require("./receive/pad_name_update");
const PadStatusUpdate = require("./receive/pad_status_update"); const PadStatusUpdate = require("./receive/pad_status_update");
const CurrentPageUpdate = require("./receive/current_page_update"); const CurrentPageUpdate = require("./receive/current_page_update");
const CurrentPageRequest = require("./receive/current_page_request");
const uuid = require('uuid'); const uuid = require('uuid');
const presets = require('./presets'); const presets = require('./presets');
...@@ -20,7 +21,8 @@ class ModuleInstance extends InstanceBase { ...@@ -20,7 +21,8 @@ class ModuleInstance extends InstanceBase {
'project-current': new ProjectUpdate(), 'project-current': new ProjectUpdate(),
'pad-name-changed': new PadNameUpdate(), 'pad-name-changed': new PadNameUpdate(),
'pad-status-changed': new PadStatusUpdate(), 'pad-status-changed': new PadStatusUpdate(),
'current-page-changed': new CurrentPageUpdate() 'current-page-changed': new CurrentPageUpdate(),
'current-page-request': new CurrentPageRequest()
}; };
currentProject = new Project({}); currentProject = new Project({});
......
const MessageExecutable = require("./message_executable");
module.exports = class CurrentPageRequest extends MessageExecutable {
handleMessage(plugin, message) {
plugin.currentProject.updateCurrentPage(message.page);
plugin.checkFeedbacks();
plugin.updateVariablesForCurrentPage();
}
}
\ No newline at end of file
...@@ -5,6 +5,8 @@ module.exports = class ProjectUpdate extends MessageExecutable { ...@@ -5,6 +5,8 @@ module.exports = class ProjectUpdate extends MessageExecutable {
handleMessage(plugin, message) { handleMessage(plugin, message) {
plugin.currentProject = new Project(message) plugin.currentProject = new Project(message)
plugin.sendToWebSocket('current-page-request', {});
plugin.checkFeedbacks(); plugin.checkFeedbacks();
plugin.updateVariables() plugin.updateVariables()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment