mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix publication load and expediente
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user