Handle user saved and no longer has permissions

This commit is contained in:
shamoon 2023-03-06 10:04:18 -08:00
parent 9902c4745d
commit 4cfc416cdc

View File

@ -474,12 +474,17 @@ export class DocumentDetailComponent
}, },
error: (error) => { error: (error) => {
this.networkActive = false this.networkActive = false
if (!this.userCanEdit) {
this.toastService.showInfo($localize`Document saved successfully.`)
this.close()
} else {
this.error = error.error this.error = error.error
this.toastService.showError( this.toastService.showError(
$localize`Error saving document` + $localize`Error saving document` +
': ' + ': ' +
(error.message ?? error.toString()) (error.message ?? error.toString())
) )
}
}, },
}) })
} }