Skip to content

Commit

Permalink
Update version handling
Browse files Browse the repository at this point in the history
  • Loading branch information
louislam committed Jul 14, 2023
1 parent 6bece87 commit be26bb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions server/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,21 @@ async function sendAPIKeyList(socket) {
/**
* Emits the version information to the client.
* @param {Socket} socket Socket.io socket instance
* @param {boolean} hideVersion
* @returns {Promise<void>}
*/
async function sendInfo(socket) {
async function sendInfo(socket, hideVersion = false) {
let version;
let latestVersion;

if (!hideVersion) {
version = checkVersion.version;
latestVersion = checkVersion.latestVersion;
}

socket.emit("info", {
version: checkVersion.version,
latestVersion: checkVersion.latestVersion,
version,
latestVersion,
primaryBaseURL: await setting("primaryBaseURL"),
serverTimezone: await server.getTimezone(),
serverTimezoneOffset: server.getTimezoneOffset(),
Expand Down
3 changes: 2 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ let needSetup = false;
log.info("server", "Adding socket handler");
io.on("connection", async (socket) => {

sendInfo(socket);
sendInfo(socket, true);

if (needSetup) {
log.info("server", "Redirect to setup page");
Expand Down Expand Up @@ -1651,6 +1651,7 @@ async function afterLogin(socket, user) {
socket.join(user.id);

let monitorList = await server.sendMonitorList(socket);
sendInfo(socket);
server.sendMaintenanceList(socket);
sendNotificationList(socket);
sendProxyList(socket);
Expand Down

0 comments on commit be26bb7

Please sign in to comment.