Skip to content

Commit

Permalink
Load metadata component after config is received
Browse files Browse the repository at this point in the history
  • Loading branch information
IshavSohal committed Feb 21, 2025
1 parent be1b434 commit c7b65d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ function logger(type, message) {
const clients = new Set();

// Used to broadcast messages to all connected clients
function broadcastToClients(message){
function broadcastToClients(message) {
const payload = JSON.stringify(message);
clients.forEach((client) => {
if(client.readyState === WebSocket.OPEN){
if (client.readyState === WebSocket.OPEN) {
logger('INFO', `Payload sent to the client`);
client.send(payload);
}
Expand All @@ -614,7 +614,7 @@ wss.on('connection', (ws) => {
// { uuid: <uuid>, lock: false }
ws.on('message', function (msg) {
const message = JSON.parse(msg);
const {uuid, lock} = message;
const { uuid, lock } = message;

if (!uuid) {
ws.send(JSON.stringify({ status: 'fail', message: 'UUID not provided.' }));
Expand All @@ -640,8 +640,8 @@ wss.on('connection', (ws) => {
ws.send(JSON.stringify({ status: 'success', secret }));

broadcastToClients({
type:'lock',
uuid,
type: 'lock',
uuid
});
}
} else {
Expand All @@ -663,8 +663,8 @@ wss.on('connection', (ws) => {
ws.send(JSON.stringify({ status: 'success' }));

broadcastToClients({
type:'unlock',
uuid,
type: 'unlock',
uuid
});
}
}
Expand All @@ -680,7 +680,7 @@ wss.on('connection', (ws) => {
delete lockedUuids[ws.uuid];
broadcastToClients({
type: 'unlock',
uuid: ws.uuid,
uuid: ws.uuid
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/metadata-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ import {
import { VueSpinnerOval } from 'vue3-spinners';
import { VueFinalModal } from 'vue-final-modal';
import { useUserStore } from '../stores/userStore';
import { computed } from "vue";
import { computed } from 'vue';
import JSZip from 'jszip';
import axios from 'axios';
Expand Down Expand Up @@ -763,7 +763,7 @@ export default class MetadataEditorV extends Vue {
// Initialize Storylines config and the configuration structure.
this.configs = { en: undefined, fr: undefined };
this.configFileStructure = undefined;
// set any metadata default values for creating new product
if (!this.loadExisting) {
// set current date as default
Expand Down Expand Up @@ -1105,6 +1105,7 @@ export default class MetadataEditorV extends Vue {
this.configFileStructureHelper(configZip);
// Extend the session on load
this.extendSession();
this.loadStatus = 'loaded';
});
});
}
Expand Down Expand Up @@ -1212,7 +1213,6 @@ export default class MetadataEditorV extends Vue {
} else {
res.json().then((json) => {
this.storylineHistory = json;
this.loadStatus = 'loaded';
});
}
});
Expand Down

0 comments on commit c7b65d3

Please sign in to comment.