fix publication load and expediente

This commit is contained in:
Peter Maquiran
2024-03-13 11:52:27 +01:00
parent 48d4cd637e
commit 7f2425ef1b
9 changed files with 2798 additions and 2760 deletions
@@ -5,7 +5,7 @@ import { v4 as uuidv4 } from 'uuid'
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
import { CMAPIService } from '../shared/repository/CMAPI/cmapi.service';
import { HubConnectionBuilder } from '@microsoft/signalr';
import { ok, err, Result } from 'neverthrow';
import { ok, err as Err, Result } from 'neverthrow';
@Injectable({
providedIn: 'root'
})
@@ -148,13 +148,21 @@ class ReconnectingWebSocketSignalR {
commit(path): Promise<Result<true, false>> {
return new Promise((resolve, reject) => {
this.connection.invoke("CommitUpload", path).then((e) => {
console.log("commit message", e)
resolve(ok(true))
}).catch(err => {
resolve(err(false))
console.error(err.toString())
});
try {
console.log('this.connection.invoke', this.connection)
this.connection.invoke("CommitUpload", path).then((e) => {
console.log("commit message", e)
resolve(ok(true))
}).catch(err => {
console.error('upload catch commit error')
resolve(Err(false))
console.error(err.toString())
});
} catch(error) {
resolve(Err(false))
console.error('upload commit error')
console.error(error)
}
})
}
@@ -390,42 +398,42 @@ export class ObjectMergeNotification{
watchCount = 0
constructor() {
// this.socket.onDisconnectCallback(()=> {
// console.log("run watch")
// this.runWatch = true
// this.watch()
// })
this.socket.onDisconnectCallback(()=> {
console.log("run watch")
this.runWatch = true
this.watch()
})
// this.socket.onConnectCallback(()=> {
this.socket.onConnectCallback(()=> {
// console.log("open trigger")
// this.runWatch = false
// })
console.log("open trigger")
this.runWatch = false
})
// this.socket.subscribe((data: socketResponse) => {
// if(data.IsCompleted == true) {
// console.log("==================!!!====================")
// try {
// this.callbacks[data.Guid](data)
// delete this.callbacks[data.Guid]
// } catch (error) {}
// } else {
// console.log("else", data)
// }
// })
this.socket.subscribe((data: socketResponse) => {
if(data.IsCompleted == true) {
console.log("==================!!!====================")
try {
this.callbacks[data.Guid](data)
delete this.callbacks[data.Guid]
} catch (error) {}
} else {
console.log("else", data)
}
})
// this.socket.connect();
// this.watch()
// this.socket.connect();
// this.watch()
}
connect() {
this.socket.connect();
// this.socket.connect();
}
close() {
this.socket.disconnect();
this.watchCount = 0;
this.runWatch = false
// this.socket.disconnect();
// this.watchCount = 0;
// this.runWatch = false
}
async watch() {