mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-09-13 08:26:18 +00:00
Add DisplayError to show user errors from the backend
This commit is contained in:
parent
53ad105f57
commit
a1fec1c93f
8 changed files with 54 additions and 25 deletions
|
@ -16,13 +16,14 @@ export enum ResponseType {
|
|||
ExportDocument = "ExportDocument",
|
||||
ExpandFolder = "ExpandFolder",
|
||||
CollapseFolder = "CollapseFolder",
|
||||
UpdateLayer = "UpdateLayer",
|
||||
SetActiveTool = "SetActiveTool",
|
||||
SetActiveDocument = "SetActiveDocument",
|
||||
UpdateOpenDocumentsList = "UpdateOpenDocumentsList",
|
||||
UpdateWorkingColors = "UpdateWorkingColors",
|
||||
UpdateLayer = "UpdateLayer",
|
||||
SetCanvasZoom = "SetCanvasZoom",
|
||||
SetCanvasRotation = "SetCanvasRotation",
|
||||
DisplayError = "DisplayError",
|
||||
DisplayConfirmationToCloseDocument = "DisplayConfirmationToCloseDocument",
|
||||
DisplayConfirmationToCloseAllDocuments = "DisplayConfirmationToCloseAllDocuments",
|
||||
}
|
||||
|
@ -72,6 +73,8 @@ function parseResponse(responseType: string, data: any): Response {
|
|||
return newExportDocument(data.ExportDocument);
|
||||
case "UpdateWorkingColors":
|
||||
return newUpdateWorkingColors(data.UpdateWorkingColors);
|
||||
case "DisplayError":
|
||||
return newDisplayError(data.DisplayError);
|
||||
case "DisplayConfirmationToCloseDocument":
|
||||
return newDisplayConfirmationToCloseDocument(data.DisplayConfirmationToCloseDocument);
|
||||
case "DisplayConfirmationToCloseAllDocuments":
|
||||
|
@ -130,6 +133,15 @@ function newSetActiveDocument(input: any): SetActiveDocument {
|
|||
};
|
||||
}
|
||||
|
||||
export interface DisplayError {
|
||||
description: string;
|
||||
}
|
||||
function newDisplayError(input: any): DisplayError {
|
||||
return {
|
||||
description: input.description,
|
||||
};
|
||||
}
|
||||
|
||||
export interface DisplayConfirmationToCloseDocument {
|
||||
document_index: number;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue