mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-10 03:37:43 +02:00
Reload when upgrade (#5942)
This commit is contained in:
@@ -38,8 +38,6 @@ import core, {
|
||||
TxApplyIf,
|
||||
TxHandler,
|
||||
TxResult,
|
||||
TxWorkspaceEvent,
|
||||
WorkspaceEvent,
|
||||
generateId,
|
||||
toFindResult
|
||||
} from '@hcengineering/core'
|
||||
@@ -356,10 +354,7 @@ class Connection implements ClientConnection {
|
||||
const txArr = Array.isArray(resp.result) ? (resp.result as Tx[]) : [resp.result as Tx]
|
||||
|
||||
for (const tx of txArr) {
|
||||
if (
|
||||
(tx?._class === core.class.TxWorkspaceEvent && (tx as TxWorkspaceEvent).event === WorkspaceEvent.Upgrade) ||
|
||||
tx?._class === core.class.TxModelUpgrade
|
||||
) {
|
||||
if (tx?._class === core.class.TxModelUpgrade) {
|
||||
console.log('Processing upgrade', this.workspace, this.email)
|
||||
this.onUpgrade?.()
|
||||
return
|
||||
|
||||
@@ -94,11 +94,13 @@ export default async () => {
|
||||
|
||||
const upgradeHandler: TxHandler = (...txes: Tx[]) => {
|
||||
for (const tx of txes) {
|
||||
if (tx?._class === core.class.TxModelUpgrade) {
|
||||
onUpgrade?.()
|
||||
return
|
||||
}
|
||||
if (tx?._class === core.class.TxWorkspaceEvent) {
|
||||
const event = tx as TxWorkspaceEvent
|
||||
if (event.event === WorkspaceEvent.Upgrade) {
|
||||
onUpgrade?.()
|
||||
} else if (event.event === WorkspaceEvent.MaintenanceNotification) {
|
||||
if (event.event === WorkspaceEvent.MaintenanceNotification) {
|
||||
void setPlatformStatus(
|
||||
new Status(Severity.WARNING, platform.status.MaintenanceWarning, {
|
||||
time: event.params.timeMinutes
|
||||
|
||||
Reference in New Issue
Block a user