mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:37:08 +00:00
Remove dead code
This commit is contained in:
@@ -1,59 +1,5 @@
|
||||
import debounce from 'lodash/debounce';
|
||||
|
||||
function old_processServerEvent({state, getters, commit, dispatch}, [message]) {
|
||||
//console.log("Processing server event", message);
|
||||
|
||||
function processPlan ({payload}) {
|
||||
if (payload.operation == "INSERT") {
|
||||
commit("setSequence", payload.new);
|
||||
} else if (payload.operation == "UPDATE") {
|
||||
commit("replaceSequence", [payload.old, payload.new]);
|
||||
} else if (payload.operation == "DELETE") {
|
||||
commit("deleteSequence", payload.old);
|
||||
}
|
||||
}
|
||||
|
||||
commit("setServerEvent", message);
|
||||
|
||||
if (!message) {
|
||||
console.error("processServerEvent called without arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.channel) {
|
||||
console.error("processServerEvent message missing channel");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.payload) {
|
||||
console.error("processServerEvent message missing payload");
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.payload.operation == "INSERT") {
|
||||
if (message.payload.new == null) {
|
||||
console.warn("Expected payload.new to be non-null");
|
||||
}
|
||||
} else if (message.payload.operation == "UPDATE") {
|
||||
if (message.payload.old == null || message.payload.new == null) {
|
||||
console.warn("Expected payload.old and paylaod.new to be non-null");
|
||||
}
|
||||
} else if (message.payload.operation == "DELETE") {
|
||||
if (message.payload.old == null) {
|
||||
console.warn("Expected payload.old to be non-null");
|
||||
}
|
||||
} else if (message.payload.operation) {
|
||||
console.warn(`Unrecognised operation: ${message.payload.operation}`);
|
||||
}
|
||||
|
||||
if (message.channel == "planned_lines") {
|
||||
// Process a change in the planner
|
||||
processPlan(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function registerHandler({ commit }, { table, handler }) {
|
||||
commit('REGISTER_HANDLER', { table, handler });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user