remove init, ws handles it

This commit is contained in:
dr-frmr 2024-10-16 17:12:12 -04:00
parent c2cce9d376
commit 8056ccb16c
No known key found for this signature in database

View File

@ -1,14 +1,5 @@
const APP_PATH = '/contacts:contacts:sys/ask';
// Fetch initial data and populate the UI
function init() {
fetch(APP_PATH)
.then(response => response.json())
.then(data => {
populate(data);
});
}
function api_call(body) {
fetch(APP_PATH, {
method: 'POST',
@ -65,9 +56,6 @@ document.getElementById('add-contact').addEventListener('submit', (e) => {
});
})
// Call init to start the application
init();
// Setup WebSocket connection
const wsProtocol = location.protocol === 'https:' ? 'wss://' : 'ws://';
const ws = new WebSocket(wsProtocol + location.host + "/contacts:contacts:sys/");