mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-24 05:33:21 +03:00
remove init, ws handles it
This commit is contained in:
parent
c2cce9d376
commit
8056ccb16c
@ -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/");
|
||||
|
Loading…
Reference in New Issue
Block a user