parent
230d4abe0c
commit
30f8ab773f
5 changed files with 11 additions and 14 deletions
|
|
@ -8,7 +8,8 @@ Idea, Issue, Work Tracking
|
||||||
- [] #2: Send change value from editing in recipe to machine
|
- [] #2: Send change value from editing in recipe to machine
|
||||||
- [] #3: Save value to recipe
|
- [] #3: Save value to recipe
|
||||||
- [] #5: revert value on close dialog recipe
|
- [] #5: revert value on close dialog recipe
|
||||||
|
- [] #6: display all recipes with materials from csv [material usages with product code]
|
||||||
|
- [] #7: material & menu creation
|
||||||
|
|
||||||
[Rejected]
|
[Rejected]
|
||||||
- [] #4: From #1, will do sync value from server, so that user could save their current edit too
|
- [] #4: From #1, will do sync value from server, so that user could save their current edit too
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,10 @@
|
||||||
let socket = get(socketStore);
|
let socket = get(socketStore);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (socket) {
|
socket?.close(1000, 'logout');
|
||||||
socket.close(1000, 'logout');
|
} catch (e) {
|
||||||
}
|
console.log('error on disconnect', e);
|
||||||
} catch (e) {}
|
}
|
||||||
|
|
||||||
socketStore.set(null);
|
socketStore.set(null);
|
||||||
if (browser && 'cookieStore' in window) await cookieStore.delete('logged_in');
|
if (browser && 'cookieStore' in window) await cookieStore.delete('logged_in');
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ type CommandRequest = 'sheet' | 'command';
|
||||||
function getServiceName(cmdReq: CommandRequest) {
|
function getServiceName(cmdReq: CommandRequest) {
|
||||||
switch (cmdReq) {
|
switch (cmdReq) {
|
||||||
case 'sheet':
|
case 'sheet':
|
||||||
return 'sheet-api';
|
return 'sheet-service';
|
||||||
case 'command':
|
case 'command':
|
||||||
return 'command';
|
return 'command';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,10 @@ export function connectToWebsocket() {
|
||||||
socketStore.set(null);
|
socketStore.set(null);
|
||||||
socket = null;
|
socket = null;
|
||||||
|
|
||||||
if (auth.currentUser) {
|
if (auth.currentUser && !socket) {
|
||||||
// console.log('try reconnect websocket ...');
|
console.log('try reconnect websocket ...');
|
||||||
// retry again
|
// retry again
|
||||||
setTimeout(() => connectToWebsocket(), 5000);
|
setTimeout(() => connectToWebsocket(), 30000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
onAuthStateChanged(auth, async function (s) {
|
onAuthStateChanged(auth, async function (s) {
|
||||||
authStore.set(s);
|
authStore.set(s);
|
||||||
authInitialized.set(true);
|
authInitialized.set(true);
|
||||||
if (s) {
|
if (s) {
|
||||||
if (browser && 'cookieStore' in window) await cookieStore.set('logged_in', 'true');
|
if (browser && 'cookieStore' in window) await cookieStore.set('logged_in', 'true');
|
||||||
else {
|
else {
|
||||||
|
|
@ -51,10 +51,6 @@
|
||||||
return authStore.subscribe(async function (user) {
|
return authStore.subscribe(async function (user) {
|
||||||
// console.log(`store get ${JSON.stringify(user)}`);
|
// console.log(`store get ${JSON.stringify(user)}`);
|
||||||
|
|
||||||
if (user != null) {
|
|
||||||
connectToWebsocket();
|
|
||||||
}
|
|
||||||
|
|
||||||
// reloading permissions
|
// reloading permissions
|
||||||
if (get(currentPermissions).length == 0 && user != null) {
|
if (get(currentPermissions).length == 0 && user != null) {
|
||||||
// need update
|
// need update
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue